linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nvmet: only check for filebacking on -ENOTBLK
@ 2018-07-25  6:34 Hannes Reinecke
  2018-07-25  7:35 ` Chaitanya Kulkarni
  2018-07-25 11:17 ` Christoph Hellwig
  0 siblings, 2 replies; 3+ messages in thread
From: Hannes Reinecke @ 2018-07-25  6:34 UTC (permalink / raw)


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.

Signed-off-by: Hannes Reinecke <hare at suse.com>
---
 drivers/nvme/target/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c
index ddd85715a00a..a216d7eb1050 100644
--- a/drivers/nvme/target/core.c
+++ b/drivers/nvme/target/core.c
@@ -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;
-- 
2.12.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] nvmet: only check for filebacking on -ENOTBLK
  2018-07-25  6:34 [PATCH] nvmet: only check for filebacking on -ENOTBLK Hannes Reinecke
@ 2018-07-25  7:35 ` Chaitanya Kulkarni
  2018-07-25 11:17 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: Chaitanya Kulkarni @ 2018-07-25  7:35 UTC (permalink / raw)


Thanks, looks good.

Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>


From: Linux-nvme <linux-nvme-bounces@lists.infradead.org> on behalf of Hannes Reinecke <hare@suse.de>
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.

Signed-off-by: Hannes Reinecke <hare at suse.com>
---
?drivers/nvme/target/core.c | 2 +-
?1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c
index ddd85715a00a..a216d7eb1050 100644
--- a/drivers/nvme/target/core.c
+++ b/drivers/nvme/target/core.c
@@ -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;
-- 
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.

    

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] nvmet: only check for filebacking on -ENOTBLK
  2018-07-25  6:34 [PATCH] nvmet: only check for filebacking on -ENOTBLK Hannes Reinecke
  2018-07-25  7:35 ` Chaitanya Kulkarni
@ 2018-07-25 11:17 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2018-07-25 11:17 UTC (permalink / raw)


Thanks,

applied to nvme-4.18.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-07-25 11:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-25  6:34 [PATCH] nvmet: only check for filebacking on -ENOTBLK Hannes Reinecke
2018-07-25  7:35 ` Chaitanya Kulkarni
2018-07-25 11:17 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).