diff --git a/src/vol/volume.c b/src/vol/volume.c index 1069edc100..0a32c81a33 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