From: Jeffrey Altman Date: Mon, 19 Nov 2012 20:33:33 +0000 (-0500) Subject: Windows: Missing lock in AFSNotifyRename X-Git-Tag: openafs-stable-1_8_0pre1~1790 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=d733f9daed95feef2eefb3d68dc16607b1321142 Windows: Missing lock in AFSNotifyRename If the ParentObjectInformation and TargetParentObjectInformation are different, the TreeLock for each must be held. Change-Id: Iac9910d838f8f35b286e4e40009cfd547ed8a438 Reviewed-on: http://gerrit.openafs.org/8479 Reviewed-by: Rod Widdowson Tested-by: BuildBot Reviewed-by: Jeffrey Altman --- diff --git a/src/WINNT/afsrdr/kernel/lib/AFSCommSupport.cpp b/src/WINNT/afsrdr/kernel/lib/AFSCommSupport.cpp index 5b60847..47d160f 100644 --- a/src/WINNT/afsrdr/kernel/lib/AFSCommSupport.cpp +++ b/src/WINNT/afsrdr/kernel/lib/AFSCommSupport.cpp @@ -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)