From 30fbf5a5cc5dfdefa0ad64b488be22b9375e5b09 Mon Sep 17 00:00:00 2001 From: Benjamin Kaduk Date: Sun, 6 Nov 2016 15:06:02 -0600 Subject: [PATCH] bos: allow salvage -salvagedirs with -all Allow the -salvagedirs option on bos salvage when invoked with the -all option to salvage the whole server. The -salvagedirs -all options will rebuild every directory on the server. Reviewed-on: https://gerrit.openafs.org/12457 Reviewed-by: Mark Vitale Tested-by: Mark Vitale Reviewed-by: Michael Meffie Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit 1637c4d7c1ce407390f65509a3a1c764a0c06aa6) [not actually cherry picked, but is the equivalent functionality] Change-Id: I3978a5c4a704e0a0f2aab1cfad75573c16496a4d Reviewed-on: https://gerrit.openafs.org/12462 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Stephan Wiesand --- src/bozo/bos.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/bozo/bos.c b/src/bozo/bos.c index b65961d08..8d0cb6869 100644 --- a/src/bozo/bos.c +++ b/src/bozo/bos.c @@ -1562,9 +1562,18 @@ SalvageCmd(struct cmd_syndesc *as, void *arock) for (i = MRAFS_OFFSET; i < ADDPARMOFFSET; i++) { if (as->parms[i].items) { - printf(" %s only possible for MR-AFS fileserver.\n", - as->parms[i].name); - stop = 1; + if (i == MRAFS_OFFSET + 5) { /* -salvagedirs */ + if (as->parms[4].items) { /* -all */ + mrafsParm.Optsalvagedirs = 1; /* Let this one slide. */ + } else { + printf(" -salvagedirs only possible with -all.\n"); + stop = 1; + } + } else { + printf(" %s only possible for MR-AFS fileserver.\n", + as->parms[i].name); + stop = 1; + } } } if (stop) -- 2.39.5