nvmet: print a hint while rejecting NSID 0 or 0xffffffff
authorMikhail Skorzhinskii <mskorzhinskiy@solarflare.com>
Thu, 4 Jul 2019 08:01:48 +0000 (10:01 +0200)
committerChristoph Hellwig <hch@lst.de>
Tue, 9 Jul 2019 21:18:09 +0000 (14:18 -0700)
Adding this hint for the sake of convenience.

It was spotted that a few times people spent some time before
understanding what is exactly wrong in configuration process.  This
should save a few time in such situations, especially for people who
is not very confident with NVMe requirements.

Signed-off-by: Mikhail Skorzhinskii <mskorzhinskiy@solarflare.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/configfs.c

index 08dd5af357f7c599587e760bc7c18c1c41c8ce8b..cd52b9f153766602036eb9e7322f845551fff855 100644 (file)
@@ -588,8 +588,10 @@ static struct config_group *nvmet_ns_make(struct config_group *group,
                goto out;
 
        ret = -EINVAL;
-       if (nsid == 0 || nsid == NVME_NSID_ALL)
+       if (nsid == 0 || nsid == NVME_NSID_ALL) {
+               pr_err("invalid nsid %#x", nsid);
                goto out;
+       }
 
        ret = -ENOMEM;
        ns = nvmet_ns_alloc(subsys, nsid);