From: Jens Axboe Date: Tue, 21 Apr 2015 15:39:32 +0000 (-0600) Subject: Fix off-by-one in cpus_allowed X-Git-Tag: fio-2.2.8~32 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=9e98688960347b9b733db9426fb7747f22d3a77e;p=fio.git Fix off-by-one in cpus_allowed Similar to commit b84113993b3a, fix it for cpus_allowed as well. Signed-off-by: Jens Axboe --- diff --git a/options.c b/options.c index b5195c35..5fbad317 100644 --- a/options.c +++ b/options.c @@ -503,9 +503,9 @@ static int set_cpus_allowed(struct thread_data *td, os_cpu_mask_t *mask, ret = 1; break; } - if (icpu > max_cpu) { + if (icpu >= max_cpu) { log_err("fio: CPU %d too large (max=%ld)\n", - icpu, max_cpu); + icpu, max_cpu - 1); ret = 1; break; }