From: Andrew Deason Date: Wed, 30 Nov 2011 23:08:57 +0000 (-0600) Subject: DAFS: Ensure GetVolume errors on ERROR volumes X-Git-Tag: upstream/1.8.0_pre1^2~2982 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=f59312c0aee1a5376b29262efc6e6ea71264305a;p=packages%2Fo%2Fopenafs.git 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 Reviewed-by: Derrick Brashear --- diff --git a/src/vol/volume.c b/src/vol/volume.c index 1069edc10..0a32c81a3 100644 --- a/src/vol/volume.c +++ b/src/vol/volume.c @@ -4085,9 +4085,17 @@ GetVolume(Error * ec, Error * client_ec, VolId volumeId, Volume * hint, vp = NULL; 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 * not VolOpRunningUnknown (attach2 would have converted it to Online