]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
DAFS: Ensure GetVolume errors on ERROR volumes
authorAndrew Deason <adeason@sinenomine.net>
Wed, 30 Nov 2011 23:08:57 +0000 (17:08 -0600)
committerDerrick Brashear <shadow@dementix.org>
Fri, 16 Dec 2011 11:54:38 +0000 (03:54 -0800)
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.

Reviewed-on: http://gerrit.openafs.org/6165
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit f59312c0aee1a5376b29262efc6e6ea71264305a)

Change-Id: Ibdd5cb5c475409918cdad1e73e2d7ed4ef57bd13
Reviewed-on: http://gerrit.openafs.org/6321
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
src/vol/volume.c

index 2415fb9074d3c20852bfa2ea1cf480ed3329f4fa..0697e92bbb81d281d542c0437afbe4aa3a95ee95 100644 (file)
@@ -4016,9 +4016,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