mirror of
https://git.openafs.org/openafs.git
synced 2025-01-19 15:30:14 +00:00
Windows: ensure TreeLock obtain and release same pointer
The indirection ObjectInformation->ParentObjectInformation does not appear to be stable. When acquiring and releasing a parent TreeLock, use a local variable to store the ParentObjectInformation pointer and use that to access the TreeLock. This will ensure that the resource obtained is the one that is released. Change-Id: If359de0f7572cfa4e401baa47affa6872b79e932 Reviewed-on: http://gerrit.openafs.org/7651 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com> Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
This commit is contained in:
parent
f3f282265a
commit
03dfcce05a
@ -65,6 +65,7 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
|
||||
AFSDeviceExt *pControlDeviceExt = NULL;
|
||||
IO_STATUS_BLOCK stIoSB;
|
||||
AFSObjectInfoCB *pObjectInfo = NULL;
|
||||
AFSObjectInfoCB *pParentObjectInfo = NULL;
|
||||
AFSFileCleanupCB stFileCleanup;
|
||||
AFSFileCleanupResultCB *pResultCB = NULL;
|
||||
ULONG ulResultLen = 0;
|
||||
@ -461,22 +462,24 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
|
||||
|
||||
SetFlag( pCcb->DirectoryCB->Flags, AFS_DIR_ENTRY_DELETED);
|
||||
|
||||
ASSERT( pObjectInfo->ParentObjectInformation != NULL);
|
||||
pParentObjectInfo = pObjectInfo->ParentObjectInformation;
|
||||
|
||||
AFSAcquireExcl( pObjectInfo->ParentObjectInformation->Specific.Directory.DirectoryNodeHdr.TreeLock,
|
||||
ASSERT( pParentObjectInfo != NULL);
|
||||
|
||||
AFSAcquireExcl( pParentObjectInfo->Specific.Directory.DirectoryNodeHdr.TreeLock,
|
||||
TRUE);
|
||||
|
||||
if ( pObjectInfo->ParentObjectInformation->DataVersion.QuadPart != pResultCB->ParentDataVersion.QuadPart - 1)
|
||||
if ( pParentObjectInfo->DataVersion.QuadPart != pResultCB->ParentDataVersion.QuadPart - 1)
|
||||
{
|
||||
|
||||
SetFlag( pObjectInfo->ParentObjectInformation->Flags, AFS_OBJECT_FLAGS_VERIFY);
|
||||
SetFlag( pParentObjectInfo->Flags, AFS_OBJECT_FLAGS_VERIFY);
|
||||
|
||||
pObjectInfo->ParentObjectInformation->DataVersion.QuadPart = (ULONGLONG)-1;
|
||||
pParentObjectInfo->DataVersion.QuadPart = (ULONGLONG)-1;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
pObjectInfo->ParentObjectInformation->DataVersion.QuadPart = pResultCB->ParentDataVersion.QuadPart;
|
||||
pParentObjectInfo->DataVersion.QuadPart = pResultCB->ParentDataVersion.QuadPart;
|
||||
}
|
||||
|
||||
//
|
||||
@ -493,7 +496,7 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
|
||||
pCcb->DirectoryCB,
|
||||
&pCcb->DirectoryCB->NameInformation.FileName);
|
||||
|
||||
AFSRemoveNameEntry( pObjectInfo->ParentObjectInformation,
|
||||
AFSRemoveNameEntry( pParentObjectInfo,
|
||||
pCcb->DirectoryCB);
|
||||
}
|
||||
else
|
||||
@ -506,9 +509,9 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
|
||||
&pCcb->DirectoryCB->NameInformation.FileName);
|
||||
}
|
||||
|
||||
AFSReleaseResource( pObjectInfo->ParentObjectInformation->Specific.Directory.DirectoryNodeHdr.TreeLock);
|
||||
AFSReleaseResource( pParentObjectInfo->Specific.Directory.DirectoryNodeHdr.TreeLock);
|
||||
|
||||
AFSFsRtlNotifyFullReportChange( pObjectInfo->ParentObjectInformation,
|
||||
AFSFsRtlNotifyFullReportChange( pParentObjectInfo,
|
||||
pCcb,
|
||||
(ULONG)FILE_NOTIFY_CHANGE_FILE_NAME,
|
||||
(ULONG)FILE_ACTION_REMOVED);
|
||||
@ -585,21 +588,23 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
|
||||
if ( NT_SUCCESS( ntStatus))
|
||||
{
|
||||
|
||||
if ( pObjectInfo->ParentObjectInformation != NULL)
|
||||
pParentObjectInfo = pObjectInfo->ParentObjectInformation;
|
||||
|
||||
if ( pParentObjectInfo != NULL)
|
||||
{
|
||||
|
||||
AFSAcquireExcl( pObjectInfo->ParentObjectInformation->Specific.Directory.DirectoryNodeHdr.TreeLock,
|
||||
AFSAcquireExcl( pParentObjectInfo->Specific.Directory.DirectoryNodeHdr.TreeLock,
|
||||
TRUE);
|
||||
|
||||
if ( pObjectInfo->ParentObjectInformation->DataVersion.QuadPart != pResultCB->ParentDataVersion.QuadPart)
|
||||
if ( pParentObjectInfo->DataVersion.QuadPart != pResultCB->ParentDataVersion.QuadPart)
|
||||
{
|
||||
|
||||
SetFlag( pObjectInfo->ParentObjectInformation->Flags, AFS_OBJECT_FLAGS_VERIFY);
|
||||
SetFlag( pParentObjectInfo->Flags, AFS_OBJECT_FLAGS_VERIFY);
|
||||
|
||||
pObjectInfo->ParentObjectInformation->DataVersion.QuadPart = (ULONGLONG)-1;
|
||||
pParentObjectInfo->DataVersion.QuadPart = (ULONGLONG)-1;
|
||||
}
|
||||
|
||||
AFSReleaseResource( pObjectInfo->ParentObjectInformation->Specific.Directory.DirectoryNodeHdr.TreeLock);
|
||||
AFSReleaseResource( pParentObjectInfo->Specific.Directory.DirectoryNodeHdr.TreeLock);
|
||||
}
|
||||
}
|
||||
|
||||
@ -629,17 +634,19 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
|
||||
// Decrement the open child handle count
|
||||
//
|
||||
|
||||
if( pObjectInfo->ParentObjectInformation != NULL)
|
||||
pParentObjectInfo = pObjectInfo->ParentObjectInformation;
|
||||
|
||||
if( pParentObjectInfo != NULL)
|
||||
{
|
||||
|
||||
ASSERT( pObjectInfo->ParentObjectInformation->Specific.Directory.ChildOpenHandleCount > 0);
|
||||
ASSERT( pParentObjectInfo->Specific.Directory.ChildOpenHandleCount > 0);
|
||||
|
||||
lCount = InterlockedDecrement( &pObjectInfo->ParentObjectInformation->Specific.Directory.ChildOpenHandleCount);
|
||||
lCount = InterlockedDecrement( &pParentObjectInfo->Specific.Directory.ChildOpenHandleCount);
|
||||
|
||||
AFSDbgLogMsg( AFS_SUBSYSTEM_FCB_REF_COUNTING,
|
||||
AFS_TRACE_LEVEL_VERBOSE,
|
||||
"AFSCleanup (File) Decrement child open handle count on Parent object %08lX Cnt %d\n",
|
||||
pObjectInfo->ParentObjectInformation,
|
||||
pParentObjectInfo,
|
||||
lCount);
|
||||
}
|
||||
|
||||
@ -811,22 +818,24 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
|
||||
|
||||
SetFlag( pCcb->DirectoryCB->Flags, AFS_DIR_ENTRY_DELETED);
|
||||
|
||||
ASSERT( pObjectInfo->ParentObjectInformation != NULL);
|
||||
pParentObjectInfo = pObjectInfo->ParentObjectInformation;
|
||||
|
||||
AFSAcquireExcl( pObjectInfo->ParentObjectInformation->Specific.Directory.DirectoryNodeHdr.TreeLock,
|
||||
ASSERT( pParentObjectInfo != NULL);
|
||||
|
||||
AFSAcquireExcl( pParentObjectInfo->Specific.Directory.DirectoryNodeHdr.TreeLock,
|
||||
TRUE);
|
||||
|
||||
if ( pObjectInfo->ParentObjectInformation->DataVersion.QuadPart != pResultCB->ParentDataVersion.QuadPart - 1)
|
||||
if ( pParentObjectInfo->DataVersion.QuadPart != pResultCB->ParentDataVersion.QuadPart - 1)
|
||||
{
|
||||
|
||||
SetFlag( pObjectInfo->ParentObjectInformation->Flags, AFS_OBJECT_FLAGS_VERIFY);
|
||||
SetFlag( pParentObjectInfo->Flags, AFS_OBJECT_FLAGS_VERIFY);
|
||||
|
||||
pObjectInfo->ParentObjectInformation->DataVersion.QuadPart = (ULONGLONG)-1;
|
||||
pParentObjectInfo->DataVersion.QuadPart = (ULONGLONG)-1;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
pObjectInfo->ParentObjectInformation->DataVersion.QuadPart = pResultCB->ParentDataVersion.QuadPart;
|
||||
pParentObjectInfo->DataVersion.QuadPart = pResultCB->ParentDataVersion.QuadPart;
|
||||
}
|
||||
|
||||
//
|
||||
@ -837,7 +846,7 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
|
||||
if( !BooleanFlagOn( pCcb->DirectoryCB->Flags, AFS_DIR_ENTRY_NOT_IN_PARENT_TREE))
|
||||
{
|
||||
|
||||
AFSRemoveNameEntry( pObjectInfo->ParentObjectInformation,
|
||||
AFSRemoveNameEntry( pParentObjectInfo,
|
||||
pCcb->DirectoryCB);
|
||||
}
|
||||
else
|
||||
@ -850,9 +859,9 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
|
||||
&pCcb->DirectoryCB->NameInformation.FileName);
|
||||
}
|
||||
|
||||
AFSReleaseResource( pObjectInfo->ParentObjectInformation->Specific.Directory.DirectoryNodeHdr.TreeLock);
|
||||
AFSReleaseResource( pParentObjectInfo->Specific.Directory.DirectoryNodeHdr.TreeLock);
|
||||
|
||||
AFSFsRtlNotifyFullReportChange( pObjectInfo->ParentObjectInformation,
|
||||
AFSFsRtlNotifyFullReportChange( pParentObjectInfo,
|
||||
pCcb,
|
||||
(ULONG)FILE_NOTIFY_CHANGE_FILE_NAME,
|
||||
(ULONG)FILE_ACTION_REMOVED);
|
||||
@ -875,12 +884,14 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
|
||||
|
||||
ClearFlag( pFcb->Flags, AFS_FCB_FLAG_FILE_MODIFIED);
|
||||
|
||||
if( pObjectInfo->ParentObjectInformation != NULL)
|
||||
pParentObjectInfo = pObjectInfo->ParentObjectInformation;
|
||||
|
||||
if( pParentObjectInfo != NULL)
|
||||
{
|
||||
|
||||
ulNotifyFilter |= (FILE_NOTIFY_CHANGE_ATTRIBUTES);
|
||||
|
||||
AFSFsRtlNotifyFullReportChange( pObjectInfo->ParentObjectInformation,
|
||||
AFSFsRtlNotifyFullReportChange( pParentObjectInfo,
|
||||
pCcb,
|
||||
(ULONG)ulNotifyFilter,
|
||||
(ULONG)FILE_ACTION_MODIFIED);
|
||||
@ -906,21 +917,23 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
|
||||
if ( NT_SUCCESS( ntStatus))
|
||||
{
|
||||
|
||||
if ( pObjectInfo->ParentObjectInformation != NULL)
|
||||
pParentObjectInfo = pObjectInfo->ParentObjectInformation;
|
||||
|
||||
if ( pParentObjectInfo != NULL)
|
||||
{
|
||||
|
||||
AFSAcquireExcl( pObjectInfo->ParentObjectInformation->Specific.Directory.DirectoryNodeHdr.TreeLock,
|
||||
AFSAcquireExcl( pParentObjectInfo->Specific.Directory.DirectoryNodeHdr.TreeLock,
|
||||
TRUE);
|
||||
|
||||
if ( pObjectInfo->ParentObjectInformation->DataVersion.QuadPart != pResultCB->ParentDataVersion.QuadPart)
|
||||
if ( pParentObjectInfo->DataVersion.QuadPart != pResultCB->ParentDataVersion.QuadPart)
|
||||
{
|
||||
|
||||
SetFlag( pObjectInfo->ParentObjectInformation->Flags, AFS_OBJECT_FLAGS_VERIFY);
|
||||
SetFlag( pParentObjectInfo->Flags, AFS_OBJECT_FLAGS_VERIFY);
|
||||
|
||||
pObjectInfo->ParentObjectInformation->DataVersion.QuadPart = (ULONGLONG)-1;
|
||||
pParentObjectInfo->DataVersion.QuadPart = (ULONGLONG)-1;
|
||||
}
|
||||
|
||||
AFSReleaseResource( pObjectInfo->ParentObjectInformation->Specific.Directory.DirectoryNodeHdr.TreeLock);
|
||||
AFSReleaseResource( pParentObjectInfo->Specific.Directory.DirectoryNodeHdr.TreeLock);
|
||||
}
|
||||
}
|
||||
|
||||
@ -958,17 +971,19 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
|
||||
// Decrement the open child handle count
|
||||
//
|
||||
|
||||
if( pObjectInfo->ParentObjectInformation != NULL)
|
||||
pParentObjectInfo = pObjectInfo->ParentObjectInformation;
|
||||
|
||||
if( pParentObjectInfo != NULL)
|
||||
{
|
||||
|
||||
ASSERT( pObjectInfo->ParentObjectInformation->Specific.Directory.ChildOpenHandleCount > 0);
|
||||
ASSERT( pParentObjectInfo->Specific.Directory.ChildOpenHandleCount > 0);
|
||||
|
||||
lCount = InterlockedDecrement( &pObjectInfo->ParentObjectInformation->Specific.Directory.ChildOpenHandleCount);
|
||||
lCount = InterlockedDecrement( &pParentObjectInfo->Specific.Directory.ChildOpenHandleCount);
|
||||
|
||||
AFSDbgLogMsg( AFS_SUBSYSTEM_FCB_REF_COUNTING,
|
||||
AFS_TRACE_LEVEL_VERBOSE,
|
||||
"AFSCleanup (Dir) Decrement child open handle count on Parent object %08lX Cnt %d\n",
|
||||
pObjectInfo->ParentObjectInformation,
|
||||
pParentObjectInfo,
|
||||
lCount);
|
||||
}
|
||||
|
||||
@ -1111,21 +1126,23 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
|
||||
|
||||
SetFlag( pCcb->DirectoryCB->Flags, AFS_DIR_ENTRY_DELETED);
|
||||
|
||||
ASSERT( pObjectInfo->ParentObjectInformation != NULL);
|
||||
pParentObjectInfo = pObjectInfo->ParentObjectInformation;
|
||||
|
||||
AFSAcquireExcl( pObjectInfo->ParentObjectInformation->Specific.Directory.DirectoryNodeHdr.TreeLock,
|
||||
ASSERT( pParentObjectInfo != NULL);
|
||||
|
||||
AFSAcquireExcl( pParentObjectInfo->Specific.Directory.DirectoryNodeHdr.TreeLock,
|
||||
TRUE);
|
||||
|
||||
if ( pObjectInfo->ParentObjectInformation->DataVersion.QuadPart != pResultCB->ParentDataVersion.QuadPart - 1)
|
||||
if ( pParentObjectInfo->DataVersion.QuadPart != pResultCB->ParentDataVersion.QuadPart - 1)
|
||||
{
|
||||
|
||||
SetFlag( pObjectInfo->ParentObjectInformation->Flags, AFS_OBJECT_FLAGS_VERIFY);
|
||||
SetFlag( pParentObjectInfo->Flags, AFS_OBJECT_FLAGS_VERIFY);
|
||||
|
||||
pObjectInfo->ParentObjectInformation->DataVersion.QuadPart = (ULONGLONG)-1;
|
||||
pParentObjectInfo->DataVersion.QuadPart = (ULONGLONG)-1;
|
||||
}
|
||||
else
|
||||
{
|
||||
pObjectInfo->ParentObjectInformation->DataVersion.QuadPart = pResultCB->ParentDataVersion.QuadPart;
|
||||
pParentObjectInfo->DataVersion.QuadPart = pResultCB->ParentDataVersion.QuadPart;
|
||||
}
|
||||
|
||||
//
|
||||
@ -1136,7 +1153,7 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
|
||||
if( !BooleanFlagOn( pCcb->DirectoryCB->Flags, AFS_DIR_ENTRY_NOT_IN_PARENT_TREE))
|
||||
{
|
||||
|
||||
AFSRemoveNameEntry( pObjectInfo->ParentObjectInformation,
|
||||
AFSRemoveNameEntry( pParentObjectInfo,
|
||||
pCcb->DirectoryCB);
|
||||
}
|
||||
else
|
||||
@ -1149,9 +1166,9 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
|
||||
&pCcb->DirectoryCB->NameInformation.FileName);
|
||||
}
|
||||
|
||||
AFSReleaseResource( pObjectInfo->ParentObjectInformation->Specific.Directory.DirectoryNodeHdr.TreeLock);
|
||||
AFSReleaseResource( pParentObjectInfo->Specific.Directory.DirectoryNodeHdr.TreeLock);
|
||||
|
||||
AFSFsRtlNotifyFullReportChange( pObjectInfo->ParentObjectInformation,
|
||||
AFSFsRtlNotifyFullReportChange( pParentObjectInfo,
|
||||
pCcb,
|
||||
(ULONG)FILE_NOTIFY_CHANGE_FILE_NAME,
|
||||
(ULONG)FILE_ACTION_REMOVED);
|
||||
@ -1174,12 +1191,14 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
|
||||
|
||||
ClearFlag( pFcb->Flags, AFS_FCB_FLAG_FILE_MODIFIED);
|
||||
|
||||
if( pObjectInfo->ParentObjectInformation != NULL)
|
||||
pParentObjectInfo = pObjectInfo->ParentObjectInformation;
|
||||
|
||||
if( pParentObjectInfo != NULL)
|
||||
{
|
||||
|
||||
ulNotifyFilter |= (FILE_NOTIFY_CHANGE_ATTRIBUTES);
|
||||
|
||||
AFSFsRtlNotifyFullReportChange( pObjectInfo->ParentObjectInformation,
|
||||
AFSFsRtlNotifyFullReportChange( pParentObjectInfo,
|
||||
pCcb,
|
||||
(ULONG)ulNotifyFilter,
|
||||
(ULONG)FILE_ACTION_MODIFIED);
|
||||
@ -1205,21 +1224,23 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
|
||||
if ( NT_SUCCESS( ntStatus))
|
||||
{
|
||||
|
||||
if ( pObjectInfo->ParentObjectInformation != NULL)
|
||||
pParentObjectInfo = pObjectInfo->ParentObjectInformation;
|
||||
|
||||
if ( pParentObjectInfo != NULL)
|
||||
{
|
||||
|
||||
AFSAcquireExcl( pObjectInfo->ParentObjectInformation->Specific.Directory.DirectoryNodeHdr.TreeLock,
|
||||
AFSAcquireExcl( pParentObjectInfo->Specific.Directory.DirectoryNodeHdr.TreeLock,
|
||||
TRUE);
|
||||
|
||||
if ( pObjectInfo->ParentObjectInformation->DataVersion.QuadPart != pResultCB->ParentDataVersion.QuadPart)
|
||||
if ( pParentObjectInfo->DataVersion.QuadPart != pResultCB->ParentDataVersion.QuadPart)
|
||||
{
|
||||
|
||||
SetFlag( pObjectInfo->ParentObjectInformation->Flags, AFS_OBJECT_FLAGS_VERIFY);
|
||||
SetFlag( pParentObjectInfo->Flags, AFS_OBJECT_FLAGS_VERIFY);
|
||||
|
||||
pObjectInfo->ParentObjectInformation->DataVersion.QuadPart = (ULONGLONG)-1;
|
||||
pParentObjectInfo->DataVersion.QuadPart = (ULONGLONG)-1;
|
||||
}
|
||||
|
||||
AFSReleaseResource( pObjectInfo->ParentObjectInformation->Specific.Directory.DirectoryNodeHdr.TreeLock);
|
||||
AFSReleaseResource( pParentObjectInfo->Specific.Directory.DirectoryNodeHdr.TreeLock);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1249,17 +1270,19 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
|
||||
// Decrement the open child handle count
|
||||
//
|
||||
|
||||
if( pObjectInfo->ParentObjectInformation != NULL)
|
||||
pParentObjectInfo = pObjectInfo->ParentObjectInformation;
|
||||
|
||||
if( pParentObjectInfo != NULL)
|
||||
{
|
||||
|
||||
ASSERT( pObjectInfo->ParentObjectInformation->Specific.Directory.ChildOpenHandleCount > 0);
|
||||
ASSERT( pParentObjectInfo->Specific.Directory.ChildOpenHandleCount > 0);
|
||||
|
||||
lCount = InterlockedDecrement( &pObjectInfo->ParentObjectInformation->Specific.Directory.ChildOpenHandleCount);
|
||||
lCount = InterlockedDecrement( &pParentObjectInfo->Specific.Directory.ChildOpenHandleCount);
|
||||
|
||||
AFSDbgLogMsg( AFS_SUBSYSTEM_FCB_REF_COUNTING,
|
||||
AFS_TRACE_LEVEL_VERBOSE,
|
||||
"AFSCleanup (MP/SL) Decrement child open handle count on Parent object %08lX Cnt %d\n",
|
||||
pObjectInfo->ParentObjectInformation,
|
||||
pParentObjectInfo,
|
||||
lCount);
|
||||
}
|
||||
|
||||
@ -1294,16 +1317,18 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
|
||||
// Decrement the open child handle count
|
||||
//
|
||||
|
||||
if( pObjectInfo->ParentObjectInformation != NULL &&
|
||||
pObjectInfo->ParentObjectInformation->Specific.Directory.ChildOpenHandleCount > 0)
|
||||
pParentObjectInfo = pObjectInfo->ParentObjectInformation;
|
||||
|
||||
if( pParentObjectInfo != NULL &&
|
||||
pParentObjectInfo->Specific.Directory.ChildOpenHandleCount > 0)
|
||||
{
|
||||
|
||||
lCount = InterlockedDecrement( &pObjectInfo->ParentObjectInformation->Specific.Directory.ChildOpenHandleCount);
|
||||
lCount = InterlockedDecrement( &pParentObjectInfo->Specific.Directory.ChildOpenHandleCount);
|
||||
|
||||
AFSDbgLogMsg( AFS_SUBSYSTEM_FCB_REF_COUNTING,
|
||||
AFS_TRACE_LEVEL_VERBOSE,
|
||||
"AFSCleanup (Share) Decrement child open handle count on Parent object %08lX Cnt %d\n",
|
||||
pObjectInfo->ParentObjectInformation,
|
||||
pParentObjectInfo,
|
||||
lCount);
|
||||
}
|
||||
|
||||
|
@ -2252,6 +2252,7 @@ AFSEvaluateTargetByID( IN AFSObjectInfoCB *ObjectInfo,
|
||||
AFSFileEvalResultCB *pEvalResultCB = NULL;
|
||||
AFSDirEnumEntry *pDirEnumCB = NULL;
|
||||
ULONG ulRequestFlags = AFS_REQUEST_FLAG_SYNCHRONOUS;
|
||||
AFSObjectInfoCB *pParentInfo = NULL;
|
||||
|
||||
__Enter
|
||||
{
|
||||
@ -2259,10 +2260,12 @@ AFSEvaluateTargetByID( IN AFSObjectInfoCB *ObjectInfo,
|
||||
RtlZeroMemory( &stTargetID,
|
||||
sizeof( AFSEvalTargetCB));
|
||||
|
||||
if( ObjectInfo->ParentObjectInformation != NULL)
|
||||
pParentInfo = ObjectInfo->ParentObjectInformation;
|
||||
|
||||
if( pParentInfo != NULL)
|
||||
{
|
||||
|
||||
stTargetID.ParentId = ObjectInfo->ParentObjectInformation->FileId;
|
||||
stTargetID.ParentId = pParentInfo->FileId;
|
||||
}
|
||||
|
||||
//
|
||||
@ -2312,17 +2315,17 @@ AFSEvaluateTargetByID( IN AFSObjectInfoCB *ObjectInfo,
|
||||
if( ntStatus == STATUS_OBJECT_PATH_INVALID)
|
||||
{
|
||||
|
||||
if( ObjectInfo->ParentObjectInformation != NULL)
|
||||
if( pParentInfo != NULL)
|
||||
{
|
||||
|
||||
AFSAcquireExcl( ObjectInfo->ParentObjectInformation->Specific.Directory.DirectoryNodeHdr.TreeLock,
|
||||
AFSAcquireExcl( pParentInfo->Specific.Directory.DirectoryNodeHdr.TreeLock,
|
||||
TRUE);
|
||||
|
||||
SetFlag( ObjectInfo->ParentObjectInformation->Flags, AFS_OBJECT_FLAGS_VERIFY);
|
||||
SetFlag( pParentInfo->Flags, AFS_OBJECT_FLAGS_VERIFY);
|
||||
|
||||
ObjectInfo->ParentObjectInformation->DataVersion.QuadPart = (ULONGLONG)-1;
|
||||
pParentInfo->DataVersion.QuadPart = (ULONGLONG)-1;
|
||||
|
||||
AFSReleaseResource( ObjectInfo->ParentObjectInformation->Specific.Directory.DirectoryNodeHdr.TreeLock);
|
||||
AFSReleaseResource( pParentInfo->Specific.Directory.DirectoryNodeHdr.TreeLock);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2333,21 +2336,21 @@ AFSEvaluateTargetByID( IN AFSObjectInfoCB *ObjectInfo,
|
||||
// Validate the parent data version
|
||||
//
|
||||
|
||||
if ( ObjectInfo->ParentObjectInformation != NULL)
|
||||
if ( pParentInfo != NULL)
|
||||
{
|
||||
|
||||
AFSAcquireExcl( ObjectInfo->ParentObjectInformation->Specific.Directory.DirectoryNodeHdr.TreeLock,
|
||||
AFSAcquireExcl( pParentInfo->Specific.Directory.DirectoryNodeHdr.TreeLock,
|
||||
TRUE);
|
||||
|
||||
if ( ObjectInfo->ParentObjectInformation->DataVersion.QuadPart != pEvalResultCB->ParentDataVersion.QuadPart)
|
||||
if ( pParentInfo->DataVersion.QuadPart != pEvalResultCB->ParentDataVersion.QuadPart)
|
||||
{
|
||||
|
||||
SetFlag( ObjectInfo->ParentObjectInformation->Flags, AFS_OBJECT_FLAGS_VERIFY);
|
||||
SetFlag( pParentInfo->Flags, AFS_OBJECT_FLAGS_VERIFY);
|
||||
|
||||
ObjectInfo->ParentObjectInformation->DataVersion.QuadPart = (ULONGLONG)-1;
|
||||
pParentInfo->DataVersion.QuadPart = (ULONGLONG)-1;
|
||||
}
|
||||
|
||||
AFSReleaseResource( ObjectInfo->ParentObjectInformation->Specific.Directory.DirectoryNodeHdr.TreeLock);
|
||||
AFSReleaseResource( pParentInfo->Specific.Directory.DirectoryNodeHdr.TreeLock);
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -2262,12 +2262,12 @@ AFSSetRenameInfo( IN PIRP Irp)
|
||||
|
||||
if( pTargetParentObject != pSrcParentObject)
|
||||
{
|
||||
AFSAcquireExcl( pSrcFcb->ObjectInformation->ParentObjectInformation->Specific.Directory.DirectoryNodeHdr.TreeLock,
|
||||
AFSAcquireExcl( pSrcParentObject->Specific.Directory.DirectoryNodeHdr.TreeLock,
|
||||
TRUE);
|
||||
|
||||
bReleaseSourceDirLock = TRUE;
|
||||
|
||||
pSourceDirLock = pSrcFcb->ObjectInformation->ParentObjectInformation->Specific.Directory.DirectoryNodeHdr.TreeLock;
|
||||
pSourceDirLock = pSrcParentObject->Specific.Directory.DirectoryNodeHdr.TreeLock;
|
||||
}
|
||||
|
||||
AFSLocateCaseSensitiveDirEntry( pTargetParentObject->Specific.Directory.DirectoryNodeHdr.CaseSensitiveTreeHead,
|
||||
|
@ -1643,9 +1643,11 @@ AFSLocateNameEntry( IN GUID *AuthGroup,
|
||||
// on the entry
|
||||
//
|
||||
|
||||
ASSERT( pCurrentObject->ParentObjectInformation != NULL);
|
||||
pParentObjectInfo = pCurrentObject->ParentObjectInformation;
|
||||
|
||||
AFSAcquireExcl( pCurrentObject->ParentObjectInformation->Specific.Directory.DirectoryNodeHdr.TreeLock,
|
||||
ASSERT( pParentObjectInfo != NULL);
|
||||
|
||||
AFSAcquireExcl( pParentObjectInfo->Specific.Directory.DirectoryNodeHdr.TreeLock,
|
||||
TRUE);
|
||||
|
||||
AFSAcquireExcl( pCurrentObject->VolumeCB->ObjectInfoTree.TreeLock,
|
||||
@ -1667,7 +1669,7 @@ AFSLocateNameEntry( IN GUID *AuthGroup,
|
||||
// Remove and delete the directory entry from the parent list
|
||||
//
|
||||
|
||||
AFSDeleteDirEntry( pCurrentObject->ParentObjectInformation,
|
||||
AFSDeleteDirEntry( pParentObjectInfo,
|
||||
pDirEntry);
|
||||
|
||||
if( pCurrentObject->ObjectReferenceCount <= 0)
|
||||
@ -1699,11 +1701,11 @@ AFSLocateNameEntry( IN GUID *AuthGroup,
|
||||
|
||||
SetFlag( pDirEntry->Flags, AFS_DIR_ENTRY_DELETED);
|
||||
|
||||
AFSRemoveNameEntry( pCurrentObject->ParentObjectInformation,
|
||||
AFSRemoveNameEntry( pParentObjectInfo,
|
||||
pDirEntry);
|
||||
}
|
||||
|
||||
AFSReleaseResource( pCurrentObject->ParentObjectInformation->Specific.Directory.DirectoryNodeHdr.TreeLock);
|
||||
AFSReleaseResource( pParentObjectInfo->Specific.Directory.DirectoryNodeHdr.TreeLock);
|
||||
|
||||
AFSReleaseResource( pCurrentObject->VolumeCB->ObjectInfoTree.TreeLock);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user