]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
vol: Avoid VBUSY/VRESTARTING trick for offline vop
authorAndrew Deason <adeason@sinenomine.net>
Wed, 2 May 2012 16:38:57 +0000 (11:38 -0500)
committerDerrick Brashear <shadow@dementix.org>
Mon, 28 May 2012 14:42:55 +0000 (07:42 -0700)
Currently, if GetVolume() finds that the volume we're trying to attach
has a vol op that leaves the volume offline, we do the
VBUSY/VRESTARTING trick as described in CheckVnode(). This doesn't
make any sense for a couple of reasons.

For one, VBUSY/VRESTARTING is not the correct error code to return to
the client when an offline vol op is in progress and vp->specialStatus
is not set everywhere else we yield VOFFLINE.

Additionally, this block of code is only hit once for a particular vol
op. Once we reach this section, the volume is in UNATTACHED state, and
so on the next iteration of GetVolume we will immediately return
VOFFLINE (or specialStatus). So the CheckVnode-like situation is not
applicable, since we are not returning VBUSY to the same client for 15
minutes; we would return VBUSY once and then return VOFFLINE.

Reviewed-on: http://gerrit.openafs.org/7302
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 21ed79aeaee2d3b2b47436db0491943829ac44a6)

Change-Id: I183db2d337c999e9aafd1eba60a80eb5b84264c7
Reviewed-on: http://gerrit.openafs.org/7490
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
src/vol/volume.c

index 53c994cf3802161e0ce19856982ccc5f56feaea7..9aa4a4fe5855d490e7fff0e771abe9ed1e71f511 100644 (file)
@@ -4107,14 +4107,7 @@ GetVolume(Error * ec, Error * client_ec, VolId volumeId, Volume * hint,
               }
           } else {
               if (client_ec) {
-                  /* see CheckVnode() in afsfileprocs.c for an explanation
-                   * of this error code logic */
-                  afs_uint32 now = FT_ApproxTime();
-                  if ((vp->stats.last_vol_op + (10 * 60)) >= now) {
-                      *client_ec = VBUSY;
-                  } else {
-                      *client_ec = VRESTARTING;
-                  }
+                  *client_ec = VOFFLINE;
               }
               *ec = VOFFLINE;
           }