]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Windows: AFSInitFcb assign pFcb->ObjectInformation
authorJeffrey Altman <jaltman@your-file-system.com>
Wed, 3 Oct 2012 01:09:35 +0000 (21:09 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Fri, 19 Oct 2012 09:47:34 +0000 (02:47 -0700)
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>
src/WINNT/afsrdr/kernel/lib/AFSFcbSupport.cpp

index 1e09d83695f0e0c3627c9839bc21b5c2b0c2ba9e..38d588b782f5f7412774908640ca8216d95f0ec1 100644 (file)
@@ -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",