MINOR: config: relax the range checks on cpu-map

Emeric reports that when MAX_THREADS and/or MAX_PROCS are set to lower
values, referencing thread or process numbers higher than these limits
in cpu-map returns errors. This is annoying because these typically are
silent settings that are expected to be used only when set. Let's switch
back to LONGBITS for this limit.
This commit is contained in:
Willy Tarreau 2019-03-05 18:14:03 +01:00
parent 8e5e1e7bf0
commit 5799e9cd37

View File

@ -942,7 +942,7 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm)
ha_alert("parsing [%s:%d] : %s expects a process number "
" ('all', 'odd', 'even', a number from 1 to %d or a range), "
" followed by a list of CPU ranges with numbers from 0 to %d.\n",
file, linenum, args[0], MAX_PROCS, LONGBITS - 1);
file, linenum, args[0], LONGBITS, LONGBITS - 1);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
@ -950,14 +950,18 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm)
if ((slash = strchr(args[1], '/')) != NULL)
*slash = 0;
if (parse_process_number(args[1], &proc, MAX_PROCS, &autoinc, &errmsg)) {
/* note: we silently ignore processes over MAX_PROCS and
* threads over MAX_THREADS so as not to make configurations a
* pain to maintain.
*/
if (parse_process_number(args[1], &proc, LONGBITS, &autoinc, &errmsg)) {
ha_alert("parsing [%s:%d] : %s : %s\n", file, linenum, args[0], errmsg);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
if (slash) {
if (parse_process_number(slash+1, &thread, MAX_THREADS, NULL, &errmsg)) {
if (parse_process_number(slash+1, &thread, LONGBITS, NULL, &errmsg)) {
ha_alert("parsing [%s:%d] : %s : %s\n", file, linenum, args[0], errmsg);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;