From fd70e3619c00bc9f7b2f80cadf3fdb348cbacf51 Mon Sep 17 00:00:00 2001 From: Niklas Cassel Date: Thu, 26 Aug 2021 16:45:05 +0000 Subject: [PATCH] io_uring: don't clear recently set sqe->rw_flags 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 Signed-off-by: Jens Axboe --- engines/io_uring.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engines/io_uring.c b/engines/io_uring.c index 600fba66..b8d4cf91 100644 --- a/engines/io_uring.c +++ b/engines/io_uring.c @@ -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) { -- 2.25.1