filesetup: Extend file size for 'null' and 'filecreate' ioengines
It was reported the fio command with following options fails because of
file access beyond the file size specified with size option.
./fio --name=test --rw=randread --runtime=10s --offset=90% --time_based --ioengine=null --size=1T --norandommap --randrepeat=0
One of the options specifies null ioengine which has FIO_DISKLESSIO and
FIO_FAKEIO flags. When FIO_DISKLESSIO flag is set, current fio code does
not extend the file size even when io_size + file_offset is larger than
real_file_size. With this, random offsets are generated within io_size +
file_offset range and fail comparison with real_file_size. This failure
does not happen with other engines such as libaio since the target file
is extended to ensure real_file_size is larger than io_size +
file_offset.
To avoid the failure, extend file size for ioengines with FIO_DISKLESSIO
and FIO_FAKEIO. This changes behavior of two ioengines only: null
ioengine and filecreate engine. It does not change behavior of all other
ioengines including 12 ioengines with FIO_DISKLESSIO flag, such as nbd,
glusterfs, pmemblk, etc.
Signed-off-by: Masato Suzuki <masato.suzuki@wdc.com>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>