From 9e98688960347b9b733db9426fb7747f22d3a77e Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 21 Apr 2015 09:39:32 -0600 Subject: [PATCH] Fix off-by-one in cpus_allowed Similar to commit b84113993b3a, fix it for cpus_allowed as well. Signed-off-by: Jens Axboe --- options.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.25.1