io_uring: don't clear recently set sqe->rw_flags
authorNiklas Cassel <niklas.cassel@wdc.com>
Thu, 26 Aug 2021 16:45:05 +0000 (16:45 +0000)
committerJens Axboe <axboe@kernel.dk>
Thu, 26 Aug 2021 16:50:05 +0000 (10:50 -0600)
Commit 7c70f506e438 ("engines/io_uring: move sqe clear out of hot path")
removed the memset of sqe from fio_ioring_prep().

This commit did add a clear of the sqe->rw_flags, however, it did so
after both RWF_UNCACHED and RWF_NOWAIT flags might have been set,
effectively clearing these flags if they got set.

This doesn't make any sense. Make sure that we clear sqe->rw_flags
before, not after, setting the flags.

Fixes: 7c70f506e438 ("engines/io_uring: move sqe clear out of hot path")
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
engines/io_uring.c

index 600fba66f6f0a9e97301bb94851c391b7bb823c5..b8d4cf91287b78c3f31b9c2da367c17c55e2262c 100644 (file)
@@ -262,8 +262,9 @@ static int fio_ioring_prep(struct thread_data *td, struct io_u *io_u)
                                sqe->len = 1;
                        }
                }
+               sqe->rw_flags = 0;
                if (!td->o.odirect && o->uncached)
-                       sqe->rw_flags = RWF_UNCACHED;
+                       sqe->rw_flags |= RWF_UNCACHED;
                if (o->nowait)
                        sqe->rw_flags |= RWF_NOWAIT;
                if (ld->ioprio_class_set)
@@ -271,7 +272,6 @@ static int fio_ioring_prep(struct thread_data *td, struct io_u *io_u)
                if (ld->ioprio_set)
                        sqe->ioprio |= td->o.ioprio;
                sqe->off = io_u->offset;
-               sqe->rw_flags = 0;
        } else if (ddir_sync(io_u->ddir)) {
                sqe->ioprio = 0;
                if (io_u->ddir == DDIR_SYNC_FILE_RANGE) {