io_uring: wait potential ->release() on resurrect
authorPavel Begunkov <asml.silence@gmail.com>
Sat, 20 Feb 2021 18:03:50 +0000 (18:03 +0000)
committerJens Axboe <axboe@kernel.dk>
Sun, 21 Feb 2021 02:02:45 +0000 (19:02 -0700)
commit88f171ab7798a1ed0b9e39867ee16f307466e870
treeebf5d995e9e60ac00006956613065a9cde92428c
parentf2303b1f8244d88ffca28d3be6166ce4835cc27a
io_uring: wait potential ->release() on resurrect

There is a short window where percpu_refs are already turned zero, but
we try to do resurrect(). Play nicer and wait for ->release() to happen
in this case and proceed as everything is ok. One downside for ctx refs
is that we can ignore signal_pending() on a rare occasion, but someone
else should check for it later if needed.

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