nvmet: only check for filebacking on -ENOTBLK
Subsystems (2)
PATCH 1/1 nvmet: only check for filebacking on -ENOTBLK
We only need to check for a file-backed namespace if nvmet_bdev_ns_enable() returns -ENOTBLK. For any other error it's pointless as the open() error will remain the same.
--- drivers/nvme/target/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/target/core.c +1 -1
@@ -344,7 +344,7 @@ int nvmet_ns_enable(struct nvmet_ns *ns) goto out_unlock; ret =nvmet_bdev_ns_enable (ns); -if (ret) +if (ret == -ENOTBLK ) ret =nvmet_file_ns_enable (ns);if (ret) goto out_unlock;
Signature · 1 line
2.12.3
PATCH 1/1 nvmet: only check for filebacking on -ENOTBLK
Thanks, looks good.
From: Linux-nvme <[email protected]> on behalf of Hannes Reinecke <[email protected]>
Sent: Tuesday, July 24, 2018 11:34 PM
To: Christoph Hellwig
Cc: Keith Busch; Hannes Reinecke; Sagi Grimberg; linux-nvme at lists.infradead.org; Hannes Reinecke
Subject: [PATCH] nvmet: only check for filebacking on -ENOTBLK
?
We only need to check for a file-backed namespace if nvmet_bdev_ns_enable() returns -ENOTBLK. For any other error it's pointless as the open() error will remain the same.
---
?drivers/nvme/target/core.c | 2 +-
?1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/target/core.c +0 -0
@@ -344,7 +344,7 @@ int nvmet_ns_enable(struct nvmet_ns *ns)
???????????????? goto out_unlock;
?
???????? ret = nvmet_bdev_ns_enable(ns);
-?????? if (ret)
+?????? if (ret == -ENOTBLK)
???????????????? ret = nvmet_file_ns_enable(ns);
???????? if (ret)
???????????????? goto out_unlock;
Signature · 12 lines
2.12.3 _______________________________________________ Linux-nvme mailing list Linux-nvme at lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-nvme Linux-nvme Info Page - lists.infradead.org lists.infradead.org To see the collection of prior postings to the list, visit the Linux-nvme Archives.. Using Linux-nvme: To post a message to all the list members, send email to linux-nvme at lists.infradead.org.
PATCH 1/1 nvmet: only check for filebacking on -ENOTBLK
In reply to Hannes ReineckeThanks,
applied to nvme-4.18.