diff options
author | Sagi Grimberg <sagi@grimberg.me> | 2022-03-21 13:57:27 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-05-25 09:57:25 +0200 |
commit | d44ff3b100b94e9f23b1e8dbe688eee9bb867ac9 (patch) | |
tree | 6cf21d338283a55fa28105e475c904d9833dc907 /drivers/nvme/target/admin-cmd.c | |
parent | b6f7efb9221ba5c6e66e3dba74b5c34c31ac81b6 (diff) | |
download | linux-stable-d44ff3b100b94e9f23b1e8dbe688eee9bb867ac9.tar.gz linux-stable-d44ff3b100b94e9f23b1e8dbe688eee9bb867ac9.tar.bz2 linux-stable-d44ff3b100b94e9f23b1e8dbe688eee9bb867ac9.zip |
nvmet: use a private workqueue instead of the system workqueue
[ Upstream commit 8832cf922151e9dfa2821736beb0ae2dd3968b6e ]
Any attempt to flush kernel-global WQs has possibility of deadlock
so we should simply stop using them, instead introduce nvmet_wq
which is the generic nvmet workqueue for work elements that
don't explicitly require a dedicated workqueue (by the mere fact
that they are using the system_wq).
Changes were done using the following replaces:
- s/schedule_work(/queue_work(nvmet_wq, /g
- s/schedule_delayed_work(/queue_delayed_work(nvmet_wq, /g
- s/flush_scheduled_work()/flush_workqueue(nvmet_wq)/g
Reported-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/nvme/target/admin-cmd.c')
-rw-r--r-- | drivers/nvme/target/admin-cmd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c index aa6d84d8848e..52bb262d267a 100644 --- a/drivers/nvme/target/admin-cmd.c +++ b/drivers/nvme/target/admin-cmd.c @@ -978,7 +978,7 @@ void nvmet_execute_async_event(struct nvmet_req *req) ctrl->async_event_cmds[ctrl->nr_async_event_cmds++] = req; mutex_unlock(&ctrl->lock); - schedule_work(&ctrl->async_event_work); + queue_work(nvmet_wq, &ctrl->async_event_work); } void nvmet_execute_keep_alive(struct nvmet_req *req) |