From: Jens Axboe Date: Tue, 30 Sep 2014 03:23:51 +0000 (-0600) Subject: filesetup: fix a bug where we overwrite the set size X-Git-Tag: fio-2.1.13~11 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=0bc27b0b7019e4c386f83258430fb6b3ac34cc06;p=fio.git filesetup: fix a bug where we overwrite the set size For the null io engine, we don't set file sizes. And we should not overwrite a potentially legitimate o->size, if total_size is zero. Signed-off-by: Jens Axboe --- diff --git a/filesetup.c b/filesetup.c index 29a76c0c..43146ba7 100644 --- a/filesetup.c +++ b/filesetup.c @@ -898,7 +898,7 @@ int setup_files(struct thread_data *td) } } - if (!o->size || o->size > total_size) + if (!o->size || (total_size && o->size > total_size)) o->size = total_size; if (o->size < td_min_bs(td)) {