io_uring: fix racy IOPOLL flush overflow
authorPavel Begunkov <asml.silence@gmail.com>
Sun, 6 Dec 2020 22:22:44 +0000 (22:22 +0000)
committerJens Axboe <axboe@kernel.dk>
Wed, 9 Dec 2020 19:04:01 +0000 (12:04 -0700)
commit634578f800652035debba3098d8ab0d21af7c7a5
treefb44b31f8d5f96c771abdb6645531e4b9ff4ff63
parent31bff9a51b264df6d144931a6a5f1d6cc815ed4b
io_uring: fix racy IOPOLL flush overflow

It's not safe to call io_cqring_overflow_flush() for IOPOLL mode without
hodling uring_lock, because it does synchronisation differently. Make
sure we have it.

As for io_ring_exit_work(), we don't even need it there because
io_ring_ctx_wait_and_kill() already set force flag making all overflowed
requests to be dropped.

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