File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -6386,16 +6386,21 @@ static int io_try_cancel_userdata(struct io_kiocb *req, u64 sqe_addr)
6386
6386
WARN_ON_ONCE (!io_wq_current_is_worker () && req -> task != current );
6387
6387
6388
6388
ret = io_async_cancel_one (req -> task -> io_uring , sqe_addr , ctx );
6389
- if (ret != - ENOENT )
6390
- return ret ;
6389
+ /*
6390
+ * Fall-through even for -EALREADY, as we may have poll armed
6391
+ * that need unarming.
6392
+ */
6393
+ if (!ret )
6394
+ return 0 ;
6391
6395
6392
6396
spin_lock (& ctx -> completion_lock );
6397
+ ret = io_poll_cancel (ctx , sqe_addr , false);
6398
+ if (ret != - ENOENT )
6399
+ goto out ;
6400
+
6393
6401
spin_lock_irq (& ctx -> timeout_lock );
6394
6402
ret = io_timeout_cancel (ctx , sqe_addr );
6395
6403
spin_unlock_irq (& ctx -> timeout_lock );
6396
- if (ret != - ENOENT )
6397
- goto out ;
6398
- ret = io_poll_cancel (ctx , sqe_addr , false);
6399
6404
out :
6400
6405
spin_unlock (& ctx -> completion_lock );
6401
6406
return ret ;
You can’t perform that action at this time.
0 commit comments