* [PATCH] io-wq: fix ref leak for req
@ 2021-03-09 3:05 yangerkun
0 siblings, 0 replies; only message in thread
From: yangerkun @ 2021-03-09 3:05 UTC (permalink / raw)
To: axboe, asml.silence; +Cc: io-uring, yi.zhang, yangerkun
do_work such as io_wq_submit_work that cancel the work will leave ref of
req as 1. Fix it by call io_run_cancel.
Fixes: 4fb6ac326204 ("io-wq: improve manager/worker handling over exec")
Signed-off-by: yangerkun <[email protected]>
---
fs/io-wq.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/io-wq.c b/fs/io-wq.c
index 28868eb4cd09..0229fed33b99 100644
--- a/fs/io-wq.c
+++ b/fs/io-wq.c
@@ -794,8 +794,7 @@ static void io_wqe_enqueue(struct io_wqe *wqe, struct io_wq_work *work)
/* Can only happen if manager creation fails after exec */
if (io_wq_fork_manager(wqe->wq) ||
test_bit(IO_WQ_BIT_EXIT, &wqe->wq->state)) {
- work->flags |= IO_WQ_WORK_CANCEL;
- wqe->wq->do_work(work);
+ io_run_cancel(work, wqe);
return;
}
--
2.25.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-03-09 2:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-09 3:05 [PATCH] io-wq: fix ref leak for req yangerkun
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox