Disallow offload IO mode for engines marked with FIO_NO_OFFLOAD
authorJens Axboe <axboe@kernel.dk>
Thu, 15 Oct 2020 02:11:56 +0000 (20:11 -0600)
committerJens Axboe <axboe@kernel.dk>
Thu, 15 Oct 2020 02:11:56 +0000 (20:11 -0600)
Previous commits did this for all async engines, this can potentially
break existing job files. There are only certain cases where it fails,
for now at least mark io_uring as one of those.

Reported-by: Jeff Furlong <jeff.furlong@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
engines/io_uring.c
ioengines.c
ioengines.h

index 69f48859d7d55cb067db928d26ab49b5a1d7b36e..b997c8d8f9d1d717aa8cfb43b019cd0c4d685fe6 100644 (file)
@@ -806,7 +806,7 @@ static int fio_ioring_close_file(struct thread_data *td, struct fio_file *f)
 static struct ioengine_ops ioengine = {
        .name                   = "io_uring",
        .version                = FIO_IOOPS_VERSION,
-       .flags                  = FIO_ASYNCIO_SYNC_TRIM,
+       .flags                  = FIO_ASYNCIO_SYNC_TRIM | FIO_NO_OFFLOAD,
        .init                   = fio_ioring_init,
        .post_init              = fio_ioring_post_init,
        .io_u_init              = fio_ioring_io_u_init,
index d3be8026c62d0e9a9fa9bbe3bf9064c336d686cf..3e43ef2f9651dbd3b806af3c2c5a4046c4d36843 100644 (file)
@@ -45,7 +45,7 @@ static bool check_engine_ops(struct thread_data *td, struct ioengine_ops *ops)
         * async engines aren't reliable with offload
         */
        if ((td->o.io_submit_mode == IO_MODE_OFFLOAD) &&
-           !(ops->flags & FIO_FAKEIO)) {
+           (ops->flags & FIO_NO_OFFLOAD)) {
                log_err("%s: can't be used with offloaded submit. Use a sync "
                        "engine\n", ops->name);
                return true;
index 54dadba2cbce34921d6d46b05c233b4aeb8c4a8a..fbe52fa4154978f2a9e6a33b586714b9b0c9c41d 100644 (file)
@@ -77,7 +77,8 @@ enum fio_ioengine_flags {
        FIO_NOSTATS     = 1 << 12,      /* don't do IO stats */
        FIO_NOFILEHASH  = 1 << 13,      /* doesn't hash the files for lookup later. */
        FIO_ASYNCIO_SYNC_TRIM
-                       = 1 << 14       /* io engine has async ->queue except for trim */
+                       = 1 << 14,      /* io engine has async ->queue except for trim */
+       FIO_NO_OFFLOAD  = 1 << 15,      /* no async offload */
 };
 
 /*