src/queue: fix reversed check for SQPOLL

A recent commit tried to get the memory semantics correct with SQPOLL,
but had one of the conditions reversed! Fix it up so that we don't use
acquire/release semantics UNLESS we're using SQPOLL, which is the only
case that matters.

Fixes: 4555346461 ("!SQPOLL setups don't need acquire/release semantics on SQ ring updates")
Link: https://github.com/axboe/liburing/issues/694
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Jens Axboe
2022-10-19 12:46:55 -07:00
parent db394db75c
commit a653bbe90f
+2 -2
View File
@@ -196,9 +196,9 @@ unsigned __io_uring_flush_sq(struct io_uring *ring)
* Ensure kernel sees the SQE updates before the tail update.
*/
if (!(ring->flags & IORING_SETUP_SQPOLL))
io_uring_smp_store_release(sq->ktail, tail);
else
IO_URING_WRITE_ONCE(*sq->ktail, tail);
else
io_uring_smp_store_release(sq->ktail, tail);
}
/*
* This _may_ look problematic, as we're not supposed to be reading