DAFS: Do not give back vol to viced after salvage
authorAndrew Deason <adeason@sinenomine.net>
Thu, 7 Apr 2011 18:51:14 +0000 (13:51 -0500)
committerDerrick Brashear <shadow@dementia.org>
Mon, 11 Apr 2011 03:49:21 +0000 (20:49 -0700)
If we VRequestSalvage_r a volume successfully, and we are not the
fileserver, we will tell the fileserver to salvage a volume. So, we do
not need to give back the volume afterwards, since telling the
fileserver that a volume needs a salvage effectively gives it back (so
the salvager can take it).

So, clear needsPutBack so we don't try to also give back the volume,
and avoid the fileserver yelling at us for trying to give back a
volume that is checked out by someone else (or is not checked out at
all).

Change-Id: I168bcf7fe6dbc186064cdf38de1ddb287a26eff3
Reviewed-on: http://gerrit.openafs.org/4445
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

src/vol/volume.c

index 63fff05..a6560f4 100644 (file)
@@ -5534,6 +5534,10 @@ VRequestSalvage_r(Error * ec, Volume * vp, int reason, int flags)
                    VOfflineForSalvage_r(vp);
                }
            }
+           /* If we are non-fileserver, we're telling the fileserver to
+            * salvage the vol, so we don't need to give it back separately. */
+           vp->needsPutBack = 0;
+
            *ec = VSALVAGING;
        } else {
            Log("VRequestSalvage: volume %u online salvaged too many times; forced offline.\n", vp->hashid);