summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2021-12-06 20:49:04 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-12-22 11:32:51 +0300
commit024f9c7cd3d8d9cb0e499b949c7e209b47287cf2 (patch)
tree8124cb3ec8a925b078ae70c9293810d3f88c2605 /fs
parentdfc3fff63793c571147930b13c0f8c689c4281ac (diff)
downloadlinux-024f9c7cd3d8d9cb0e499b949c7e209b47287cf2.tar.xz
io-wq: remove spurious bit clear on task_work addition
commit e47498afeca9a0c6d07eeeacc46d563555a3f677 upstream. There's a small race here where the task_work could finish and drop the worker itself, so that by the time that task_work_add() returns with a successful addition we've already put the worker. The worker callbacks clear this bit themselves, so we don't actually need to manually clear it in the caller. Get rid of it. Reported-by: syzbot+b60c982cb0efc5e05a47@syzkaller.appspotmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/io-wq.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/io-wq.c b/fs/io-wq.c
index e8f77903d775..0d27c2a7d2cd 100644
--- a/fs/io-wq.c
+++ b/fs/io-wq.c
@@ -359,10 +359,8 @@ static bool io_queue_worker_create(struct io_worker *worker,
init_task_work(&worker->create_work, func);
worker->create_index = acct->index;
- if (!task_work_add(wq->task, &worker->create_work, TWA_SIGNAL)) {
- clear_bit_unlock(0, &worker->create_state);
+ if (!task_work_add(wq->task, &worker->create_work, TWA_SIGNAL))
return true;
- }
clear_bit_unlock(0, &worker->create_state);
fail_release:
io_worker_release(worker);