Don't proceed with error set when failed to pre-read files/devices
authorTomohiro Kusumi <tkusumi@tuxera.com>
Tue, 28 Mar 2017 20:02:56 +0000 (23:02 +0300)
committerJens Axboe <axboe@fb.com>
Tue, 28 Mar 2017 21:14:20 +0000 (15:14 -0600)
commitafe0d59a6e3cfd146ffba3c060bc423cabb3c624
tree3f5b8c7ed4f564c03ce29f17cd58c248cb54beb9
parent736f1188e50f74e7755706cfe40ddcf3e7420ed2
Don't proceed with error set when failed to pre-read files/devices

pre_read_files() never fails (never returns negative), and because
of this behavior, fio threads can continue regardless of td_verror()
call while prereading, and results in statistics with error in it,
which is quite confusing as to how it should be interpreted for regular
users.

This commit makes pre_read_files() return -1 if preread fails, and
eventually aborts fio, which is also the case with some other options.
It also changes non error return from 1 to 0, since all it matters
is if it's <0 or not, and fio normally uses 0 for success.

Not sure what the proper way of fixing this is if it legitimately
failed for some error on prereading though. Some options just print
a message to indicate it's unsupported and continue normally withtout
any error set.

Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
filesetup.c