mirror of
https://git.openafs.org/openafs.git
synced 2025-01-21 00:10:15 +00:00
Windows: AFSInitFcb STATUS_REPARSE cleanup
If a race is detected when creating a new File Control Block in AFSInitFcb() the Fcb Header must be torn down and the ExtentsResource and DirtyExtentsListLock must be deleted prior to freeing the pool memory. Change-Id: I3c3f45aed26ea62b4d20e5c5e80d1237d96c912c Reviewed-on: http://gerrit.openafs.org/7326 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com> Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
This commit is contained in:
parent
f12a20e227
commit
e691a757d6
@ -59,7 +59,6 @@ AFSInitFcb( IN AFSDirectoryCB *DirEntry)
|
|||||||
AFSFcb *pFcb = NULL;
|
AFSFcb *pFcb = NULL;
|
||||||
AFSNonPagedFcb *pNPFcb = NULL;
|
AFSNonPagedFcb *pNPFcb = NULL;
|
||||||
IO_STATUS_BLOCK stIoSb = {0,0};
|
IO_STATUS_BLOCK stIoSb = {0,0};
|
||||||
BOOLEAN bUninitFileLock = FALSE;
|
|
||||||
USHORT usFcbLength = 0;
|
USHORT usFcbLength = 0;
|
||||||
ULONGLONG ullIndex = 0;
|
ULONGLONG ullIndex = 0;
|
||||||
AFSDirEnumEntry *pDirEnumCB = NULL;
|
AFSDirEnumEntry *pDirEnumCB = NULL;
|
||||||
@ -193,8 +192,6 @@ AFSInitFcb( IN AFSDirectoryCB *DirEntry)
|
|||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
bUninitFileLock = TRUE;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Initialize the header file sizes to our dir entry information
|
// Initialize the header file sizes to our dir entry information
|
||||||
//
|
//
|
||||||
@ -314,32 +311,34 @@ try_exit:
|
|||||||
if( pFcb != NULL)
|
if( pFcb != NULL)
|
||||||
{
|
{
|
||||||
|
|
||||||
if( bUninitFileLock)
|
|
||||||
{
|
|
||||||
|
|
||||||
FsRtlUninitializeFileLock( &pFcb->Specific.File.FileLock);
|
|
||||||
}
|
|
||||||
|
|
||||||
if( pNPFcb != NULL)
|
if( pNPFcb != NULL)
|
||||||
{
|
{
|
||||||
|
|
||||||
AFSReleaseResource( &pNPFcb->Resource);
|
AFSReleaseResource( &pNPFcb->Resource);
|
||||||
|
|
||||||
|
FsRtlTeardownPerStreamContexts( &pFcb->Header);
|
||||||
|
|
||||||
|
if ( pObjectInfo->FileType == AFS_FILE_TYPE_FILE)
|
||||||
|
{
|
||||||
|
|
||||||
|
FsRtlUninitializeFileLock( &pFcb->Specific.File.FileLock);
|
||||||
|
|
||||||
|
ExDeleteResourceLite( &pNPFcb->Specific.File.ExtentsResource);
|
||||||
|
|
||||||
|
ExDeleteResourceLite( &pNPFcb->Specific.File.DirtyExtentsListLock);
|
||||||
|
}
|
||||||
|
|
||||||
ExDeleteResourceLite( &pNPFcb->PagingResource);
|
ExDeleteResourceLite( &pNPFcb->PagingResource);
|
||||||
|
|
||||||
ExDeleteResourceLite( &pNPFcb->CcbListLock);
|
ExDeleteResourceLite( &pNPFcb->CcbListLock);
|
||||||
|
|
||||||
ExDeleteResourceLite( &pNPFcb->Resource);
|
ExDeleteResourceLite( &pNPFcb->Resource);
|
||||||
|
|
||||||
|
AFSExFreePool( pNPFcb);
|
||||||
}
|
}
|
||||||
|
|
||||||
AFSExFreePool( pFcb);
|
AFSExFreePool( pFcb);
|
||||||
}
|
}
|
||||||
|
|
||||||
if( pNPFcb != NULL)
|
|
||||||
{
|
|
||||||
|
|
||||||
AFSExFreePool( pNPFcb);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user