mirror of
https://git.openafs.org/openafs.git
synced 2025-01-19 15:30:14 +00:00
Windows: AFSInitFcb assign pFcb->ObjectInformation
In AFSInitFcb() assign pFcb->ObjectInformation before the InterlockedExchangePointer call and not afterwards. Assigning it afterwards leaves a small race where the ObjectInformation value will be invalid. Change-Id: Ie79587e0b2f161b7ff612fc4fb283135bafd1085 Reviewed-on: http://gerrit.openafs.org/8222 Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com> 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
7fd9890162
commit
7b1115d470
@ -260,8 +260,11 @@ AFSInitFcb( IN AFSDirectoryCB *DirEntry)
|
||||
pFcb->Header.NodeTypeCode = AFS_INVALID_FCB;
|
||||
}
|
||||
|
||||
pFcb->ObjectInformation = pObjectInfo;
|
||||
|
||||
//
|
||||
// Initialize some fields in the Fcb
|
||||
// Swap the allocated FCB into the ObjectInformation structure if it
|
||||
// does not already have one.
|
||||
//
|
||||
|
||||
if ( InterlockedCompareExchangePointer( (PVOID *)&pObjectInfo->Fcb, pFcb, NULL) != NULL)
|
||||
@ -286,8 +289,6 @@ AFSInitFcb( IN AFSDirectoryCB *DirEntry)
|
||||
try_return( ntStatus = STATUS_REPARSE);
|
||||
}
|
||||
|
||||
pFcb->ObjectInformation = pObjectInfo;
|
||||
|
||||
AFSDbgLogMsg( AFS_SUBSYSTEM_FCB_REF_COUNTING,
|
||||
AFS_TRACE_LEVEL_VERBOSE,
|
||||
"AFSInitFcb Initialized Fcb %08lX Name %wZ\n",
|
||||
|
Loading…
Reference in New Issue
Block a user