From ce4f103eb7e1c4c04b46bf2a3448cf83932573a7 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Sun, 25 Jun 2006 02:51:40 +0000 Subject: [PATCH] DEVEL15-windows-report-quota-diskfull-20060624 overquota and diskfull errors are detected while writing dirty buffers to the file server. A flag is set on the scp so that the error can be returned to the caller. cm_FSync was clearing the flag without returning the error. This permitted calls to Win32 WriteFile to report success even when they failed. (cherry picked from commit 8e0033ba73ef9551cb24052ef90db677e4adad50) --- src/WINNT/afsd/cm_vnodeops.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/WINNT/afsd/cm_vnodeops.c b/src/WINNT/afsd/cm_vnodeops.c index ce7c606dc..2d6da5569 100644 --- a/src/WINNT/afsd/cm_vnodeops.c +++ b/src/WINNT/afsd/cm_vnodeops.c @@ -2321,12 +2321,17 @@ long cm_FSync(cm_scache_t *scp, cm_user_t *userp, cm_req_t *reqp) lock_ReleaseWrite(&scp->bufCreateLock); if (code == 0) { lock_ObtainMutex(&scp->mx); - scp->flags &= ~(CM_SCACHEFLAG_OVERQUOTA - | CM_SCACHEFLAG_OUTOFSPACE); + if (scp->mask & (CM_SCACHEMASK_TRUNCPOS | CM_SCACHEMASK_CLIENTMODTIME | CM_SCACHEMASK_LENGTH)) code = cm_StoreMini(scp, userp, reqp); + + if (scp->flags & (CM_SCACHEFLAG_OVERQUOTA | CM_SCACHEFLAG_OUTOFSPACE)) { + code = (scp->flags & CM_SCACHEFLAG_OVERQUOTA) ? CM_ERROR_QUOTA : CM_ERROR_SPACE; + scp->flags &= ~(CM_SCACHEFLAG_OVERQUOTA | CM_SCACHEFLAG_OUTOFSPACE); + } + lock_ReleaseMutex(&scp->mx); } return code; -- 2.39.5