io_uring: fix poll full SQ detection

io_uring_poll shouldn't signal EPOLLOUT | EPOLLWRNORM if the queue is
full; the old check would always signal EPOLLOUT | EPOLLWRNORM (unless
there were U32_MAX - 1 entries in the SQ queue).

Signed-off-by: Stefan Bühler <source@stbuehler.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by Stefan Bühler and committed by Jens Axboe fb775faa 0d7bae69

Changed files
+2 -1
fs
+2 -1
fs/io_uring.c
··· 2576 2576 poll_wait(file, &ctx->cq_wait, wait); 2577 2577 /* See comment at the top of this file */ 2578 2578 smp_rmb(); 2579 - if (READ_ONCE(ctx->sq_ring->r.tail) + 1 != ctx->cached_sq_head) 2579 + if (READ_ONCE(ctx->sq_ring->r.tail) - ctx->cached_sq_head != 2580 + ctx->sq_ring->ring_entries) 2580 2581 mask |= EPOLLOUT | EPOLLWRNORM; 2581 2582 if (READ_ONCE(ctx->cq_ring->r.head) != ctx->cached_cq_tail) 2582 2583 mask |= EPOLLIN | EPOLLRDNORM;