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.6.1.pre1^2~153 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=0548587958317c6ebd73081e36e511102442ea0f;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. Reviewed-on: http://gerrit.openafs.org/2649 Tested-by: Andrew Deason Tested-by: BuildBot Reviewed-by: Derrick Brashear (cherry picked from commit 575bdaf56e8f5503513bec113653fbbe525ae228) Change-Id: Ie0ebfcf1b5c88816ef58eab109fb05de4c7fad1e Reviewed-on: http://gerrit.openafs.org/5749 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- diff --git a/src/viced/viced.c b/src/viced/viced.c index 63a652374..d717b2da5 100644 --- a/src/viced/viced.c +++ b/src/viced/viced.c @@ -1196,11 +1196,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")) {