windows-report-quota-diskfull-20060624
authorJeffrey Altman <jaltman@secure-endpoints.com>
Sun, 25 Jun 2006 02:47:04 +0000 (02:47 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Sun, 25 Jun 2006 02:47:04 +0000 (02:47 +0000)
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.

src/WINNT/afsd/cm_vnodeops.c

index ce7c606..2d6da55 100644 (file)
@@ -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;