summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2019-11-27 17:02:21 -0700
committerJens Axboe <axboe@kernel.dk>2019-11-27 17:02:21 -0700
commitd77a67ed5f27a37db11b7fbc871a4bf0e4c492da (patch)
treef5b75a89f5d3bebf960b57412560b0dc498db883
parent4cc37def4ddbaa8687e2c18756d02b612af4da70 (diff)
downloadliburing-d77a67ed5f27a37db11b7fbc871a4bf0e4c492da.tar.gz
liburing-d77a67ed5f27a37db11b7fbc871a4bf0e4c492da.tar.bz2
__io_uring_submit: always check sq_ring_needs_enter()
If SQPOLL is used, we must always call sq_ring_needs_enter(). Otherwise we don't get IORING_ENTER_SQ_WAKEUP set in the flags, and we don't wake the sq thread. Fixes: https://github.com/axboe/liburing/issues/24 Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--src/queue.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/queue.c b/src/queue.c
index 4f6fd67..77d3d02 100644
--- a/src/queue.c
+++ b/src/queue.c
@@ -174,7 +174,7 @@ static int __io_uring_submit(struct io_uring *ring, unsigned submitted,
int ret;
flags = 0;
- if (wait_nr || sq_ring_needs_enter(ring, &flags)) {
+ if (sq_ring_needs_enter(ring, &flags) || wait_nr) {
if (wait_nr)
flags |= IORING_ENTER_GETEVENTS;