Windows: RDR_CleanupFileEntry protect lock release
authorJeffrey Altman <jaltman@your-file-system.com>
Wed, 7 Nov 2012 21:34:23 +0000 (16:34 -0500)
committerJeffrey Altman <jaltman@your-file-system.com>
Thu, 8 Nov 2012 00:45:28 +0000 (16:45 -0800)
Prevent lock release of scp->rw when not held.

Change-Id: I9ed3ca464a7881cd365ebe3560d5a6da22e21c86
Reviewed-on: http://gerrit.openafs.org/8372
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/afsrdr/user/RDRFunction.c

index 24d1483..0c12007 100644 (file)
@@ -1907,8 +1907,10 @@ RDR_CleanupFileEntry( IN cm_user_t *userp,
 
         /* call setattr */
         if (setAttr.mask) {
-            lock_ReleaseWrite(&scp->rw);
-            bScpLocked = FALSE;
+            if (bScpLocked) {
+                lock_ReleaseWrite(&scp->rw);
+                bScpLocked = FALSE;
+            }
             code = cm_SetAttr(scp, &setAttr, userp, &req);
         } else
             code = 0;