Windows: prevent race assigning Fcb in AFSInitFcb()
authorJeffrey Altman <jaltman@your-file-system.com>
Wed, 18 Jan 2012 00:43:54 +0000 (19:43 -0500)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 19 Jan 2012 23:38:50 +0000 (15:38 -0800)
commitafeb3c3a83ed0869e4a70b0725e3f85713330c3a
tree0c9e6bf2a4a6a22050f1e741abbeafc3941533ca
parent503d09413add1831dff5db24ee907eec59eda9e2
Windows: prevent race assigning Fcb in AFSInitFcb()

AFSInitFcb() is executed when the ObjectInformation->Fcb pointer
is NULL.  More than one thread can make that determination at the
same time.  Use InterlockedCompareExchangePointer() to detect
a race and permit cleanup to be performed.

Remove the output parameter of AFSInitFcb() to avoid a double
assignment.

Change-Id: I3870cccd5cd5e95134446523cce3547a2135d5e3
Reviewed-on: http://gerrit.openafs.org/6562
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
src/WINNT/afsrdr/kernel/lib/AFSCreate.cpp
src/WINNT/afsrdr/kernel/lib/AFSFcbSupport.cpp
src/WINNT/afsrdr/kernel/lib/Include/AFSCommon.h