Windows: Avoid race during PIOCtl DirNode allocation
authorJeffrey Altman <jaltman@your-file-system.com>
Sat, 4 Feb 2012 22:26:02 +0000 (17:26 -0500)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 6 Feb 2012 07:22:21 +0000 (23:22 -0800)
commit39d152810de9adfa89acb994506d0b9d368395f2
tree128e4fca3d3b4ca2a1a7a0c9835db3a5efa6b329
parentb819d3e3abcfedf10a1c91a26f45d0d85e6b93f1
Windows: Avoid race during PIOCtl DirNode allocation

Use InterlockedCompareExchangePointer to assign the DirNode to
ObjectInfo->Specific.Directory.PIOCtlDirectoryCB.  Otherwise,
one thread could race with another thread when allocating the
pioctl object.

Change-Id: Ic5b1a0ff2e44f2c4520cc7f5e536bd876bc83a65
Reviewed-on: http://gerrit.openafs.org/6661
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
src/WINNT/afsrdr/kernel/lib/AFSGeneric.cpp