[PATCH] nvmet: Remove unnecessary assignment to ret in nvmet_ns_enable()

Mohamed Khalfella mkhalfella at purestorage.com
Fri Jul 25 16:06:39 PDT 2025


Commit 74d16965d7ac ("nvmet-loop: avoid using mutex in IO hotpath")
moved checking maximum number of namespaces in subsystem from
nvmet_ns_enable() to nvmet_ns_alloc(). The assignment to ret in
nvmet_ns_enable() is no longer needed, remove it.

Fixex: 74d16965d7ac ("nvmet-loop: avoid using mutex in IO hotpath")
Signed-off-by: Mohamed Khalfella <mkhalfella at purestorage.com>
---
 drivers/nvme/target/core.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c
index b6247e4afc9c..83f3d2f8ef2d 100644
--- a/drivers/nvme/target/core.c
+++ b/drivers/nvme/target/core.c
@@ -581,8 +581,6 @@ int nvmet_ns_enable(struct nvmet_ns *ns)
 	if (ns->enabled)
 		goto out_unlock;
 
-	ret = -EMFILE;
-
 	ret = nvmet_bdev_ns_enable(ns);
 	if (ret == -ENOTBLK)
 		ret = nvmet_file_ns_enable(ns);
-- 
2.49.1




More information about the Linux-nvme mailing list