summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2018-03-06 12:42:57 -0700
committerJens Axboe <axboe@kernel.dk>2018-03-06 12:42:57 -0700
commit825b0a75ded0b3bec4d70ea8ea50af3cad7abab5 (patch)
tree5573c29a4b0e471fd6beef424778c4b8a9fc8386
parentb979af5cba25e31dc2a8f2fd89ac5e40c24b6519 (diff)
downloadfio-825b0a75ded0b3bec4d70ea8ea50af3cad7abab5.tar.gz
fio-825b0a75ded0b3bec4d70ea8ea50af3cad7abab5.tar.bz2
Don't make fadvise failure fatal
It's just an advisory hint. Warn once that it failed, then march on. Fixes: https://github.com/axboe/fio/issues/554 Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--debug.h1
-rw-r--r--ioengines.c4
2 files changed, 3 insertions, 2 deletions
diff --git a/debug.h b/debug.h
index ba622146..ac5f2ccd 100644
--- a/debug.h
+++ b/debug.h
@@ -43,6 +43,7 @@ enum {
FIO_WARN_VERIFY_BUF = 2,
FIO_WARN_ZONED_BUG = 4,
FIO_WARN_IOLOG_DROP = 8,
+ FIO_WARN_FADVISE = 16,
};
#ifdef FIO_INC_DEBUG
diff --git a/ioengines.c b/ioengines.c
index 5dd2311a..965581aa 100644
--- a/ioengines.c
+++ b/ioengines.c
@@ -498,8 +498,8 @@ int td_io_open_file(struct thread_data *td, struct fio_file *f)
}
if (posix_fadvise(f->fd, f->file_offset, f->io_size, flags) < 0) {
- td_verror(td, errno, "fadvise");
- goto err;
+ if (!fio_did_warn(FIO_WARN_FADVISE))
+ log_err("fio: fadvise hint failed\n");
}
}
#ifdef FIO_HAVE_WRITE_HINT