Windows: avoid race when writing mountPointString
authorJeffrey Altman <jaltman@your-file-system.com>
Tue, 19 Apr 2011 04:12:49 +0000 (00:12 -0400)
committerJeffrey Altman <jaltman@openafs.org>
Tue, 19 Apr 2011 14:03:10 +0000 (07:03 -0700)
commit04950bec1b1d6c1eeb782fff82d7568af44e7443
treea3f64d47d0ab8d46676ed1c7e015627808a4568b
parent1105d63ddf5a32b9381ff47e8101c3f141366fa6
Windows: avoid race when writing mountPointString

cm_GetData() drops the cm_scache_t rw lock which permits other
threads to access the data while it is in an inconsistent state.
Avoid the race by using a stack allocated temporary buffer to
receive the data from cm_GetData().  Only copy the data into
the mountPointStringp buffer under the rwlock.

Change-Id: Ica853976b1094be1087e49c22d878f8ae7fca03a
Reviewed-on: http://gerrit.openafs.org/4498
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
src/WINNT/afsd/cm_vnodeops.c