dafs: preattach should wait for exclusive states
authorMark Vitale <mvitale@sinenomine.net>
Fri, 21 Dec 2012 22:56:14 +0000 (17:56 -0500)
committerDerrick Brashear <shadow@your-file-system.com>
Tue, 5 Feb 2013 11:48:42 +0000 (03:48 -0800)
commit1f891b622e9b32a068082087eae9d787057f7f00
tree16f0e08517193361f32fd376f02e0300a3de8848
parent804a0db1bbfbb4bcd14f3308ce6e77e2aa1323f6
dafs: preattach should wait for exclusive states

In rare circumstances an FSYNC_VOL_ON operation may fail silently,
leaving the volume in its previous state.  The only clue is a FileLog
message "volume <nnnn> not in quiescent state".

This is caused by a race condition in the volume package: an
FSYNC_VOL_ON operation is attempting to preattach a volume
(in VPreAttachVolumeByVp_r()) at the same time a fileserver RPC
(e.g. FetchStatus) is detaching the volume (in VReleaseVolumeHandles_r())
at the conclusion of attach2() logic.

The fix calls VWaitExclusiveState_r() before calling
VPreAttachVolumeByVp_r().

Change-Id: Ib66859381d29311fda3e08984dcb740eadafb340
Reviewed-on: http://gerrit.openafs.org/8814
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
src/vol/volume.c