From 4512d04a9b721cd9052c0e8fe026c93faf6edb9e Mon Sep 17 00:00:00 2001 From: Kailas Zadbuke Date: Thu, 7 May 2020 23:55:39 -0400 Subject: [PATCH] salvaged: Fix "-parallel all" parsing In salavageserver -parallel option takes "all" argument. However the code does not parse the numeric part correctly. Due to this, only single instance of salvageserver process was running even if we provide the larger number with "all" argument. With this fix, numeric part of "all" argument will be parsed correctly and will start required number of salvageserver instances. Change-Id: Ib6318b1d57d04fecb84915e2dabe40930ea76499 Reviewed-on: https://gerrit.openafs.org/14201 Tested-by: BuildBot Reviewed-by: Andrew Deason Reviewed-by: Benjamin Kaduk --- src/vol/salvaged.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/vol/salvaged.c b/src/vol/salvaged.c index bb6de65391..54c4a635b9 100644 --- a/src/vol/salvaged.c +++ b/src/vol/salvaged.c @@ -211,11 +211,13 @@ handleit(struct cmd_syndesc *opts, void *arock) cmd_OptionAsFlag(opts, OPT_salvagedirs, &RebuildDirs); cmd_OptionAsFlag(opts, OPT_blockreads, &forceR); if (cmd_OptionAsString(opts, OPT_parallel, &optstring) == 0) { + char *input = optstring; if (strncmp(optstring, "all", 3) == 0) { PartsPerDisk = 1; + input += 3; } - if (strlen(optstring) != 0) { - Parallel = atoi(optstring); + if (strlen(input) != 0) { + Parallel = atoi(input); if (Parallel < 1) Parallel = 1; if (Parallel > MAXPARALLEL) {