author: Jens Axboe <axboe@kernel.dk> 2021-04-01 19:57:07 -0600
committer: Jens Axboe <axboe@kernel.dk> 2021-04-11 19:30:25 -0600
commit: c80ca4707d1aa8b6ba2cb8e57a521ebb6f9f22a2
parent: c7aab1a7c52b82d9afd7e03c398eb03dc2aa0507
Commit Summary:
Diffstat:
1 file changed, 10 insertions, 1 deletion
diff --git a/fs/io-wq.c b/fs/io-wq.c
index 8ba4ccaafbaf..5551272cf553 100644
--- a/fs/io-wq.c
+++ b/fs/io-wq.c
@@ -986,6 +986,16 @@ err_wq:
return ERR_PTR(ret);
}
+static bool io_task_work_match(struct callback_head *cb, void *data)
+{
+ struct create_worker_data *cwd;
+
+ if (cb->func != create_worker_cb)
+ return false;
+ cwd = container_of(cb, struct create_worker_data, work);
+ return cwd->wqe->wq == data;
+}
+
static void io_wq_exit_workers(struct io_wq *wq)
{
struct callback_head *cb;
@@ -996,7 +1006,7 @@ static void io_wq_exit_workers(struct io_wq *wq)
if (!wq->task)
return;
- while ((cb = task_work_cancel(wq->task, create_worker_cb)) != NULL) {
+ while ((cb = task_work_cancel_match(wq->task, io_task_work_match, wq)) != NULL) {
struct create_worker_data *cwd;
cwd = container_of(cb, struct create_worker_data, work);