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

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).