From: Jens Axboe Date: Wed, 18 May 2016 21:06:05 +0000 (-0600) Subject: filesetup: align a size given as a percentage to the block size X-Git-Tag: fio-2.10~19 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=e391c70489d9f63612bce419d7fa0df5d15abf16 filesetup: align a size given as a percentage to the block size We want it to be a nice multiple of (at least) our minimum block size. Signed-off-by: Jens Axboe --- diff --git a/filesetup.c b/filesetup.c index 9c37ae57..f721c36a 100644 --- a/filesetup.c +++ b/filesetup.c @@ -894,8 +894,10 @@ int setup_files(struct thread_data *td) if (f->io_size == -1ULL) total_size = -1ULL; else { - if (o->size_percent) - f->io_size = (f->io_size * o->size_percent) / 100; + if (o->size_percent) { + f->io_size = (f->io_size * o->size_percent) / 100; + f->io_size -= (f->io_size % td_min_bs(td)); + } total_size += f->io_size; }