Skip to contentSkip to conversation

io_uring: fix warning in io_try_cancel_userdata()

PATCH New Hao Xu 1 participant 1 message Oct 27, 2021

Subsystems (2)
lore
Share & tools
lore

Hao Xu

author
#0 lore raw

PATCH 1/1 io_uring: fix warning in io_try_cancel_userdata()

task work can run in system-wq, so enhance the warnning in io_try_cancel_userdata() to reflect it.

---
 fs/io_uring.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/io_uring.c +2 -1
index 0099decac71d..a2a4b9d04404 100644
@@ -6294,7 +6294,8 @@ static int io_try_cancel_userdata(struct io_kiocb *req, u64 sqe_addr)
 	struct io_ring_ctx *ctx = req->ctx;
 	int ret;
 
-	WARN_ON_ONCE(!io_wq_current_is_worker() && req->task != current);
+	WARN_ON_ONCE(!io_wq_current_is_worker() &&
+		     !(current->flags & PF_WQ_WORKER) && req->task != current);
 
 	ret = io_async_cancel_one(req->task->io_uring, sqe_addr, ctx);
 	if (ret != -ENOENT)
Signature · 1 line
2.24.4