Windows: Missing lock in AFSNotifyRename
[openafs.git] / src / WINNT / afsrdr / kernel / lib / AFSCommSupport.cpp
index 5b60847..47d160f 100644 (file)
@@ -2168,6 +2168,9 @@ AFSNotifyRename( IN AFSObjectInfoCB *ObjectInfo,
         if ( ParentObjectInfo != TargetParentObjectInfo)
         {
 
+            AFSAcquireExcl( TargetParentObjectInfo->Specific.Directory.DirectoryNodeHdr.TreeLock,
+                            TRUE);
+
             if ( TargetParentObjectInfo->DataVersion.QuadPart == pRenameResultCB->TargetParentDataVersion.QuadPart - 1)
             {
 
@@ -2243,6 +2246,12 @@ AFSNotifyRename( IN AFSObjectInfoCB *ObjectInfo,
             DirectoryCB->Type.Data.ShortNameTreeEntry.HashIndex = 0;
         }
 
+        if ( ParentObjectInfo != TargetParentObjectInfo)
+        {
+
+            AFSReleaseResource( TargetParentObjectInfo->Specific.Directory.DirectoryNodeHdr.TreeLock);
+        }
+
         AFSReleaseResource( ParentObjectInfo->Specific.Directory.DirectoryNodeHdr.TreeLock);
 
         if( UpdatedFID != NULL)