From d733f9daed95feef2eefb3d68dc16607b1321142 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Mon, 19 Nov 2012 15:33:33 -0500 Subject: [PATCH] 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 --- src/WINNT/afsrdr/kernel/lib/AFSCommSupport.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/WINNT/afsrdr/kernel/lib/AFSCommSupport.cpp b/src/WINNT/afsrdr/kernel/lib/AFSCommSupport.cpp index 5b60847121..47d160f6d2 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)