Windows: Do not call buf_ClearRDRFlag unlink/rmdir
authorJeffrey Altman <jaltman@your-file-system.com>
Sat, 6 Oct 2012 05:40:47 +0000 (01:40 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Fri, 19 Oct 2012 09:43:40 +0000 (02:43 -0700)
When processing unlink and remdir operations initiated by the
SMB stack do not call  buf_ClearRDRFlag.  The redirector upon
receiving the AFS_INVALIDATE_DELETE call will cancel outstanding
extent operations, mark the FCB deleted, and tear down any held
extents.

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

src/WINNT/afsd/cm_vnodeops.c

index e31a341..2fc73bd 100644 (file)
@@ -1726,7 +1726,6 @@ long cm_Unlink(cm_scache_t *dscp, fschar_t *fnamep, clientchar_t * cnamep,
                               dscp->fileType, AFS_INVALIDATE_DATA_VERSION);
 
     if (scp) {
-        cm_ReleaseSCache(scp);
         if (code == 0) {
            lock_ObtainWrite(&scp->rw);
             if (--scp->linkCount == 0) {
@@ -1738,12 +1737,12 @@ long cm_Unlink(cm_scache_t *dscp, fschar_t *fnamep, clientchar_t * cnamep,
             }
             cm_DiscardSCache(scp);
            lock_ReleaseWrite(&scp->rw);
-            if (RDR_Initialized && !(reqp->flags & CM_REQ_SOURCE_REDIR) &&
-                !RDR_InvalidateObject(scp->fid.cell, scp->fid.volume, scp->fid.vnode,
-                                      scp->fid.unique, scp->fid.hash,
-                                      scp->fileType, AFS_INVALIDATE_DELETED))
-                buf_ClearRDRFlag(scp, "unlink");
+            if (RDR_Initialized && !(reqp->flags & CM_REQ_SOURCE_REDIR))
+                RDR_InvalidateObject(scp->fid.cell, scp->fid.volume, scp->fid.vnode,
+                                     scp->fid.unique, scp->fid.hash,
+                                     scp->fileType, AFS_INVALIDATE_DELETED);
         }
+        cm_ReleaseSCache(scp);
     }
 
   done:
@@ -3645,7 +3644,6 @@ long cm_RemoveDir(cm_scache_t *dscp, fschar_t *fnamep, clientchar_t *cnamep, cm_
     cm_EndDirOp(&dirop);
 
     if (scp) {
-        cm_ReleaseSCache(scp);
         if (code == 0) {
            lock_ObtainWrite(&scp->rw);
             scp->flags |= CM_SCACHEFLAG_DELETED;
@@ -3654,12 +3652,12 @@ long cm_RemoveDir(cm_scache_t *dscp, fschar_t *fnamep, clientchar_t *cnamep, cm_
             cm_RemoveSCacheFromHashTable(scp);
             lock_ReleaseWrite(&cm_scacheLock);
            lock_ReleaseWrite(&scp->rw);
-            if (RDR_Initialized && !(reqp->flags & CM_REQ_SOURCE_REDIR) &&
-                !RDR_InvalidateObject(scp->fid.cell, scp->fid.volume, scp->fid.vnode,
-                                      scp->fid.unique, scp->fid.hash,
-                                      scp->fileType, AFS_INVALIDATE_DELETED))
-                buf_ClearRDRFlag(scp, "rmdir");
+            if (RDR_Initialized && !(reqp->flags & CM_REQ_SOURCE_REDIR))
+                RDR_InvalidateObject(scp->fid.cell, scp->fid.volume, scp->fid.vnode,
+                                     scp->fid.unique, scp->fid.hash,
+                                     scp->fileType, AFS_INVALIDATE_DELETED);
         }
+        cm_ReleaseSCache(scp);
     }
 
   done: