* [PATCH] io_uring: fix warning in io_try_cancel_userdata()
@ 2021-10-27 10:14 Hao Xu
0 siblings, 0 replies; only message in thread
From: Hao Xu @ 2021-10-27 10:14 UTC (permalink / raw)
To: Jens Axboe; +Cc: io-uring, Pavel Begunkov, Joseph Qi
task work can run in system-wq, so enhance the warnning in
io_try_cancel_userdata() to reflect it.
Cc: [email protected]
Reported-by: Abaci Robot <[email protected]>
Signed-off-by: Hao Xu <[email protected]>
---
fs/io_uring.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 0099decac71d..a2a4b9d04404 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -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)
--
2.24.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-10-27 10:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-27 10:14 [PATCH] io_uring: fix warning in io_try_cancel_userdata() Hao Xu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox