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 <rdw@steadingsoftware.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
This commit is contained in:
Jeffrey Altman 2012-11-19 15:33:33 -05:00
parent 8245b2bc7a
commit d733f9daed

View 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)