提交 e47498af 编写于 作者: J Jens Axboe

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: syzbot+b60c982cb0efc5e05a47@syzkaller.appspotmail.com
Signed-off-by: NJens Axboe <axboe@kernel.dk>
上级 a226abcd
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册