Skip to content

Commit

Permalink
nvmet: print a hint while rejecting NSID 0 or 0xffffffff
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mikhail Skorzhinskii authored and Christoph Hellwig committed Jul 9, 2019
1 parent 04e70bd commit 5ba8950
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/nvme/target/configfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5ba8950

Please sign in to comment.