]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Windows FindACLCache must hold scp write locked
authorJeffrey Altman <jaltman@your-file-system.com>
Mon, 2 Apr 2012 10:57:53 +0000 (06:57 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Fri, 7 Dec 2012 00:38:28 +0000 (16:38 -0800)
In the SMB modules, calls to cm_FindACLCache() were not
holding the cm_scache_t rwlock writed locked as required.

Reviewed-on: http://gerrit.openafs.org/7015
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 0896602f6e7c409990fcae40dd54f84260312472)

Change-Id: I29313f479ae2487a615b065d601ee5d0ef994ccf
Reviewed-on: http://gerrit.openafs.org/8619
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
src/WINNT/afsd/smb.c
src/WINNT/afsd/smb3.c

index 8c6502385de68cc8cba8351a13bbd664ed5aa813..9b8200f0cf0f3f5a2bd6e65ed579998a98b19bbf 100644 (file)
@@ -4627,17 +4627,17 @@ smb_ApplyDirListPatches(cm_scache_t * dscp, smb_dirListPatch_t **dirPatchespp,
     afs_uint32 rights;
     afs_int32 mustFake = 0;
 
+    lock_ObtainWrite(&dscp->rw);
     code = cm_FindACLCache(dscp, userp, &rights);
     if (code == -1) {
-        lock_ObtainWrite(&dscp->rw);
         code = cm_SyncOp(dscp, NULL, userp, reqp, PRSFS_READ,
                           CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS);
-        lock_ReleaseWrite(&dscp->rw);
         if (code == CM_ERROR_NOACCESS) {
             mustFake = 1;
             code = 0;
         }
     }
+    lock_ReleaseWrite(&dscp->rw);
     if (code)
         goto cleanup;
 
index 4d229e3b778ed0808d1f6c6cfdb0c0309ac9beda..eb11db23327b12435bed2ca247882b0928625cf7 100644 (file)
@@ -4551,19 +4551,19 @@ smb_ApplyV3DirListPatches(cm_scache_t *dscp, smb_dirListPatch_t **dirPatchespp,
     afs_int32 mustFake = 0;
     clientchar_t path[AFSPATHMAX];
 
+    lock_ObtainWrite(&dscp->rw);
     code = cm_FindACLCache(dscp, userp, &rights);
     if (code == -1) {
-        lock_ObtainWrite(&dscp->rw);
         code = cm_SyncOp(dscp, NULL, userp, reqp, PRSFS_READ,
                           CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS);
         if (code == 0)
             cm_SyncOpDone(dscp, NULL, CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS);
-        lock_ReleaseWrite(&dscp->rw);
         if (code == CM_ERROR_NOACCESS) {
             mustFake = 1;
             code = 0;
         }
     }
+    lock_ReleaseWrite(&dscp->rw);
     if (code)
         goto cleanup;