Don't allow pre_read on IO engines that cannot seek
We cannot pre-read files, if we cannot seek back and read the same
data again. So just disable it with a warning to the user.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/init.c b/init.c
index 305f660..160bdff 100644
--- a/init.c
+++ b/init.c
@@ -350,8 +350,12 @@
if (td->o.verify != VERIFY_NONE)
td->o.refill_buffers = 1;
- if (td->o.pre_read)
+ if (td->o.pre_read) {
td->o.invalidate_cache = 0;
+ if (td->io_ops->flags & FIO_PIPEIO)
+ log_info("fio: cannot pre-read files with an IO engine"
+ " that isn't seekable. Pre-read disabled.\n");
+ }
if (td->o.mem_align) {
if (td->o.odirect && !is_power_of_2(td->o.mem_align)) {