Don't make fadvise failure fatal
authorJens Axboe <axboe@kernel.dk>
Tue, 6 Mar 2018 19:42:57 +0000 (12:42 -0700)
committerJens Axboe <axboe@kernel.dk>
Tue, 6 Mar 2018 19:42:57 +0000 (12:42 -0700)
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>
debug.h
ioengines.c

diff --git a/debug.h b/debug.h
index ba62214683769b32a6ab31ac0f543628ce658269..ac5f2ccdd55177d4817a4e623c78563fa279eee9 100644 (file)
--- 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
index 5dd2311af03db24c344ea35887a7f2f3a3f4885a..965581aa4157c8594fbc20735a8ac36f438d24b7 100644 (file)
@@ -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