io_uring: only return -EBUSY for submit on non-flushed backlog
authorJens Axboe <axboe@kernel.dk>
Fri, 22 Nov 2019 04:01:26 +0000 (21:01 -0700)
committerJens Axboe <axboe@kernel.dk>
Tue, 26 Nov 2019 02:56:11 +0000 (19:56 -0700)
commitc4a2ed72c9a61594b6afc23e1fbc78878d32b5a3
tree6375063a0714ee09939f2660af0fba287e3abf96
parentf9bd67f69af56d712bfd498f5ad9cf7bb177d600
io_uring: only return -EBUSY for submit on non-flushed backlog

We return -EBUSY on submit when we have a CQ ring overflow backlog, but
that can be a bit problematic if the application is using pure userspace
poll of the CQ ring. For that case, if the ring briefly overflowed and
we have pending entries in the backlog, the submit flushes the backlog
successfully but still returns -EBUSY. If we're able to fully flush the
CQ ring backlog, let the submission proceed.

Reported-by: Dan Melnic <dmm@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c