Fix io_uring_sq_ready()

This is supposed to return the entries that are actually in the SQ
ring, not the liburing copy. This fixes an issue where if you fail
to submit IO the first time (eg got -EBUSY), then a subsequent
submit would think we had nothing to submit.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Jens Axboe
2019-11-22 09:18:34 -07:00
parent b7d7554397
commit c5bc0ed798
+1 -1
View File
@@ -297,7 +297,7 @@ static inline void io_uring_prep_link_timeout(struct io_uring_sqe *sqe,
static inline unsigned io_uring_sq_ready(struct io_uring *ring)
{
return ring->sq.sqe_tail - ring->sq.sqe_head;
return *ring->sq.ktail - *ring->sq.khead;
}
static inline unsigned io_uring_sq_space_left(struct io_uring *ring)