Previously, we only enforced the calculated lwp/thread maximum when
the -p argument was specified. When -L was specified, we set lwps to
128, which can be over the max of (effectively)
MAX_FILESERVER_THREAD-FILESERVER_HELPER_THREADS, depending on the
value of MAX_FILESERVER_THREAD.
Instead, enforce the lwps min/max after all code to set the lwps has
run.
Change-Id: Ia9fc29855e74631509ea558cfe1b17fcf46e900e
Reviewed-on: http://gerrit.openafs.org/3903
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
int Sawbusy = 0;
int i;
int bufSize = 0; /* temp variable to read in udp socket buf size */
+ int lwps_max;
char *auditFileName = NULL;
for (i = 1; i < argc; i++) {
} else if (!strcmp(argv[i], "-S")) {
SawS = 1;
} else if (!strcmp(argv[i], "-p")) {
- int lwps_max =
- max_fileserver_thread() - FILESERVER_HELPER_THREADS;
Sawlwps = 1;
if ((i + 1) >= argc) {
fprintf(stderr, "missing argument for -p\n");
return -1;
}
lwps = atoi(argv[++i]);
- if (lwps > lwps_max)
- lwps = lwps_max;
- else if (lwps < 6)
- lwps = 6;
} else if (!strcmp(argv[i], "-b")) {
Sawbufs = 1;
if ((i + 1) >= argc) {
if (auditFileName)
osi_audit_file(auditFileName);
+ lwps_max = max_fileserver_thread() - FILESERVER_HELPER_THREADS;
+ if (lwps > lwps_max)
+ lwps = lwps_max;
+ else if (lwps < 6)
+ lwps = 6;
+
return (0);
} /*ParseArgs */