mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-16 04:04:06 +00:00
io_uring: hold uring mutex around poll removal
Snipped from commit 9ca9fb24d5
upstream.
While reworking the poll hashing in the v6.0 kernel, we ended up
grabbing the ctx->uring_lock in poll update/removal. This also fixed
a bug with linked timeouts racing with timeout expiry and poll
removal.
Bring back just the locking fix for that.
Reported-and-tested-by: Querijn Voet <querijnqyn@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
1524eab7e9
commit
29d37f0b6d
1 changed files with 3 additions and 0 deletions
|
@ -6111,6 +6111,8 @@ static int io_poll_update(struct io_kiocb *req, unsigned int issue_flags)
|
|||
struct io_kiocb *preq;
|
||||
int ret2, ret = 0;
|
||||
|
||||
io_ring_submit_lock(ctx, !(issue_flags & IO_URING_F_NONBLOCK));
|
||||
|
||||
spin_lock(&ctx->completion_lock);
|
||||
preq = io_poll_find(ctx, req->poll_update.old_user_data, true);
|
||||
if (!preq || !io_poll_disarm(preq)) {
|
||||
|
@ -6142,6 +6144,7 @@ out:
|
|||
req_set_fail(req);
|
||||
/* complete update request, we're done with it */
|
||||
io_req_complete(req, ret);
|
||||
io_ring_submit_unlock(ctx, !(issue_flags & IO_URING_F_NONBLOCK));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue