DAFS: Ensure GetVolume errors on ERROR volumes

In GetVolume, after we call VAttachVolumeByVp_r, there is no explicit
check to see if vp is in VOL_STATE_ERROR state. Make sure we don't try
to use such a volume, or blindly transition the volume away from that
state.

Change-Id: Ib2c975ac215eeff28b4ff5f5bb0a387298d7aab9
Reviewed-on: http://gerrit.openafs.org/6165
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
This commit is contained in:
Andrew Deason 2011-11-30 17:08:57 -06:00 committed by Derrick Brashear
parent 5fc2365f5d
commit f59312c0ae

View File

@ -4085,9 +4085,17 @@ GetVolume(Error * ec, Error * client_ec, VolId volumeId, Volume * hint,
vp = NULL; vp = NULL;
break; break;
} }
#endif
#ifdef AFS_DEMAND_ATTACH_FS if (VIsErrorState(V_attachState(vp))) {
/* make sure we don't take a vp in VOL_STATE_ERROR state and use
* it, or transition it out of that state */
if (!*ec) {
*ec = VNOVOL;
}
vp = NULL;
break;
}
/* /*
* this test MUST happen after VAttachVolymeByVp, so vol_op_state is * this test MUST happen after VAttachVolymeByVp, so vol_op_state is
* not VolOpRunningUnknown (attach2 would have converted it to Online * not VolOpRunningUnknown (attach2 would have converted it to Online