summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2021-03-06 12:02:18 +0100
committerJens Axboe <axboe@kernel.dk>2021-03-07 22:12:43 +0100
commit678eeba481d8c161203382832a4379d507050aed (patch)
tree4edfcde6eb9417bc9d25b0ec93cd71cae79c83be /fs
parentio_uring: cancel reqs of all iowq's on ring exit (diff)
downloadlinux-678eeba481d8c161203382832a4379d507050aed.tar.xz
linux-678eeba481d8c161203382832a4379d507050aed.zip
io-wq: warn on creating manager while exiting
Add a simple warning making sure that nobody tries to create a new manager while we're under IO_WQ_BIT_EXIT. That can potentially happen due to racy work submission after final put. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs')
-rw-r--r--fs/io-wq.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/io-wq.c b/fs/io-wq.c
index 1bfdb86336e4..1ab9324e602f 100644
--- a/fs/io-wq.c
+++ b/fs/io-wq.c
@@ -774,6 +774,8 @@ static int io_wq_fork_manager(struct io_wq *wq)
if (wq->manager)
return 0;
+ WARN_ON_ONCE(test_bit(IO_WQ_BIT_EXIT, &wq->state));
+
init_completion(&wq->worker_done);
atomic_set(&wq->worker_refs, 1);
tsk = create_io_thread(io_wq_manager, wq, NUMA_NO_NODE);