Skip to content

Commit e47498a

Browse files
committed
io-wq: remove spurious bit clear on task_work addition
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: [email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent a226abc commit e47498a

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

fs/io-wq.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -359,10 +359,8 @@ static bool io_queue_worker_create(struct io_worker *worker,
359359

360360
init_task_work(&worker->create_work, func);
361361
worker->create_index = acct->index;
362-
if (!task_work_add(wq->task, &worker->create_work, TWA_SIGNAL)) {
363-
clear_bit_unlock(0, &worker->create_state);
362+
if (!task_work_add(wq->task, &worker->create_work, TWA_SIGNAL))
364363
return true;
365-
}
366364
clear_bit_unlock(0, &worker->create_state);
367365
fail_release:
368366
io_worker_release(worker);

0 commit comments

Comments
 (0)