list = &ctx->cancel_hash[i];
                hlist_for_each_entry_safe(req, tmp, list, hash_node) {
-                       if (io_match_task_safe(req, tsk, cancel_all))
-                               posted += io_poll_remove_one(req);
 -                      if (io_match_task(req, tsk, cancel_all)) {
++                      if (io_match_task_safe(req, tsk, cancel_all)) {
+                               io_poll_cancel_req(req);
+                               found = true;
+                       }
                }
        }
        spin_unlock(&ctx->completion_lock);
        return percpu_counter_sum(&tctx->inflight);
  }
  
- static __cold void io_uring_drop_tctx_refs(struct task_struct *task)
- {
-       struct io_uring_task *tctx = task->io_uring;
-       unsigned int refs = tctx->cached_refs;
- 
-       if (refs) {
-               tctx->cached_refs = 0;
-               percpu_counter_sub(&tctx->inflight, refs);
-               put_task_struct_many(task, refs);
-       }
- }
- 
  /*
   * Find any io_uring ctx that this task has registered or done IO on, and cancel
 - * requests. @sqd should be not-null IIF it's an SQPOLL thread cancellation.
 + * requests. @sqd should be not-null IFF it's an SQPOLL thread cancellation.
   */
  static __cold void io_uring_cancel_generic(bool cancel_all,
                                           struct io_sq_data *sqd)