[PATCH] nvme-loop: set blocking flag

Keith Busch kbusch at meta.com
Thu Oct 17 10:20:52 PDT 2024


From: Keith Busch <kbusch at kernel.org>

Commit 505363957fad ("nvmet: fix nvme status code when namespace is
disabled") introduced a mutex lock in the io path for target. The loop
target connects this to the blk-mq submission side, so it requires the
blocking flag set so that queue_rq doesn't happen inside an rcu context.

Reported-by: Shinichiro Kawasaki <shinichiro.kawasaki at wdc.com>
Signed-off-by: Keith Busch <kbusch at kernel.org>
---
 drivers/nvme/target/loop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/target/loop.c b/drivers/nvme/target/loop.c
index e32790d8fc260..77dd809fe4507 100644
--- a/drivers/nvme/target/loop.c
+++ b/drivers/nvme/target/loop.c
@@ -479,7 +479,7 @@ static void nvme_loop_reset_ctrl_work(struct work_struct *work)
 static const struct nvme_ctrl_ops nvme_loop_ctrl_ops = {
 	.name			= "loop",
 	.module			= THIS_MODULE,
-	.flags			= NVME_F_FABRICS,
+	.flags			= NVME_F_FABRICS | NVME_F_BLOCKING,
 	.reg_read32		= nvmf_reg_read32,
 	.reg_read64		= nvmf_reg_read64,
 	.reg_write32		= nvmf_reg_write32,
-- 
2.43.5




More information about the Linux-nvme mailing list