From: Andrew Deason Date: Thu, 2 Sep 2010 17:56:28 +0000 (-0500) Subject: DAFS: Do not ignore out-of-range -vhashsize X-Git-Tag: upstream/1.8.0_pre1^2~4827 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=575bdaf56e8f5503513bec113653fbbe525ae228;p=packages%2Fo%2Fopenafs.git DAFS: Do not ignore out-of-range -vhashsize If the specified -vhashsize is out of the 6-14 range, do not just ignore it. Instead, note the error and quit. Change-Id: I2a26443bbd3a91183435a26562bea48b8b6a1eda Reviewed-on: http://gerrit.openafs.org/2649 Tested-by: Andrew Deason Tested-by: BuildBot Reviewed-by: Derrick Brashear --- diff --git a/src/viced/viced.c b/src/viced/viced.c index ce5342a47..6f0c2823c 100644 --- a/src/viced/viced.c +++ b/src/viced/viced.c @@ -1203,11 +1203,17 @@ ParseArgs(int argc, char *argv[]) return -1; } } else if (!strcmp(argv[i], "-vhashsize")) { + int hashsize; if ((i + 1) >= argc) { fprintf(stderr, "missing argument for %s\n", argv[i]); return -1; } - VSetVolHashSize(atoi(argv[++i])); + hashsize = atoi(argv[++i]); + if (VSetVolHashSize(hashsize)) { + fprintf(stderr, "specified -vhashsize (%s) is invalid or out " + "of range\n", argv[i]); + return -1; + } } else if (!strcmp(argv[i], "-vlrudisable")) { VLRU_SetOptions(VLRU_SET_ENABLED, 0); } else if (!strcmp(argv[i], "-vlruthresh")) {