Windows: buf_CleanLocked no callback for deleted file
authorJeffrey Altman <jaltman@your-file-system.com>
Fri, 16 Aug 2013 15:58:18 +0000 (11:58 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Wed, 21 Aug 2013 03:27:06 +0000 (20:27 -0700)
If the cm_scache flags indicate the object is CM_SCACHEFLAG_DELETED,
do not request a callback.  Simply invalidate the data in the buffer
and move on.

Change-Id: Id461dc20dda53c93eb87f2648f6279877e4a34d6
Reviewed-on: http://gerrit.openafs.org/10139
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

src/WINNT/afsd/cm_buf.c

index 184ced3..e6b3872 100644 (file)
@@ -859,13 +859,17 @@ afs_uint32 buf_CleanLocked(cm_scache_t *scp, cm_buf_t *bp, cm_req_t *reqp,
     {
         release_scp = 1;
 
-        lock_ObtainWrite(&scp->rw);
-        code = cm_SyncOp(scp, NULL, bp->userp ? bp->userp : cm_rootUserp, reqp, 0,
-                         CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS);
-        if (code == 0) {
-            cm_SyncOpDone(scp, NULL, CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS);
+       if (scp->flags & CM_SCACHEFLAG_DELETED) {
+           code = CM_ERROR_NOSUCHFILE;
+       } else {
+           lock_ObtainWrite(&scp->rw);
+           code = cm_SyncOp(scp, NULL, bp->userp ? bp->userp : cm_rootUserp, reqp, 0,
+                           CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS);
+           if (code == 0) {
+               cm_SyncOpDone(scp, NULL, CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS);
+           }
+           lock_ReleaseWrite(&scp->rw);
         }
-        lock_ReleaseWrite(&scp->rw);
     }
 
     if (scp && (scp->flags & CM_SCACHEFLAG_DELETED)) {