diff options
author | Vincent Fu <vincent.fu@wdc.com> | 2019-09-11 10:56:40 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-09-11 09:00:17 -0600 |
commit | ad46c5715ffc5d4e70d2e941225b1f504f23e409 (patch) | |
tree | bbc16eb81c4c40f070c466251e46903d7fb949e8 | |
parent | 4a4199035ee07da312b5a611637a164ebe8a4805 (diff) | |
download | fio-ad46c5715ffc5d4e70d2e941225b1f504f23e409.tar.gz fio-ad46c5715ffc5d4e70d2e941225b1f504f23e409.tar.bz2 |
filesetup: honor the offset option
Commands like the following do not honor the value given by the offset
option:
./fio --name=test --rw=randread --runtime=10s --offset=90% --time_based --ioengine=null --size=1T --norandommap --randrepeat=0
./fio --name=test --size=8k --offset=4k
In the random case, eventually a random offset will be generated beyond
the 1T file size, leading to a failure.
In the sequential case, a 12k file will be created despite size
specifying the 8k end boundary.
This patch modifies setup_files() so that f->io_size incorporates the
offset for cases like those above.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | filesetup.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/filesetup.c b/filesetup.c index 7904d187..b8d1d838 100644 --- a/filesetup.c +++ b/filesetup.c @@ -1047,7 +1047,7 @@ int setup_files(struct thread_data *td) * doesn't divide nicely with the min blocksize, * make the first files bigger. */ - f->io_size = fs; + f->io_size = fs - f->file_offset; if (nr_fs_extra) { nr_fs_extra--; f->io_size += bs; |