io_uring: fix io_cqring_events()'s noflush
authorPavel Begunkov <asml.silence@gmail.com>
Sun, 6 Dec 2020 22:22:45 +0000 (22:22 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Dec 2020 10:54:03 +0000 (11:54 +0100)
commit821d12a15cc264f3597c93dc5d44d6e9bbf9f3a3
tree5f8c817fff59b14136b3dc5c9e9dedead1c06469
parent54677c80ba1cfb47984c76d9d67d282dc5ce9fb9
io_uring: fix io_cqring_events()'s noflush

commit 59850d226e4907a6f37c1d2fe5ba97546a8691a4 upstream.

Checking !list_empty(&ctx->cq_overflow_list) around noflush in
io_cqring_events() is racy, because if it fails but a request overflowed
just after that, io_cqring_overflow_flush() still will be called.

Remove the second check, it shouldn't be a problem for performance,
because there is cq_check_overflow bit check just above.

Cc: <stable@vger.kernel.org> # 5.5+
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/io_uring.c