From: Hannes Reinecke Date: Wed, 25 Jul 2018 06:34:45 +0000 (+0200) Subject: nvmet: only check for filebacking on -ENOTBLK X-Git-Tag: v4.19~515^2~5^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=405a7519607e7a364114896264440c0f87b325c0;p=platform%2Fkernel%2Flinux-rpi3.git 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. Fixes: d5eff33e ("nvmet: add simple file backed ns support") Signed-off-by: Hannes Reinecke Reviewed-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig --- diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c index 74d4b78..9838103f 100644 --- a/drivers/nvme/target/core.c +++ b/drivers/nvme/target/core.c @@ -339,7 +339,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;