nvmet: print a hint while rejecting NSID 0 or 0xffffffff
Subsystems (2)
PATCH 1/1 nvmet: print a hint while rejecting NSID 0 or 0xffffffff
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.
--- drivers/nvme/target/configfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/nvme/target/configfs.c +3 -1
@@ -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);
Signature · 1 line
2.16.4
PATCH 1/1 nvmet: print a hint while rejecting NSID 0 or 0xffffffff
Quoted 18 lines · Mikhail Skorzhinskii
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 at solarflare.com>--- drivers/nvme/target/configfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/nvme/target/configfs.c +0
-0@@ -588,8 +588,10 @@ static struct config_group *nvmet_ns_make(struct config_group *group, goto out;
drivers/nvme/target/configfs.c static struct config_group *nvmet_ns_make(struct config_group *group, · line 597
Quoted 10 lines
drivers/nvme/target/configfs.c +3
-1ret = -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);
If Linux users want to figure out which code reported an error message they sometimes run grep over the Linux kernel source code. Seeing the above message makes me wonder whether enough context information is provided to allow users to figure out unambiguously which code reported the error message? Have you considered to include the function name in the error message?
Thanks,
Bart.
PATCH 1/1 nvmet: print a hint while rejecting NSID 0 or 0xffffffff
Quoted 30 lines · Bart Van Assche
Quoted 29 lines · Mikhail Skorzhinskii
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 at solarflare.com>---
?drivers/nvme/target/configfs.c| 4 +++-
? 1 file changed, 3 insertions(+), 1 deletion(-)drivers/nvme/target/configfs.c +3
-1@@ -588,8 +588,10 @@ static struct config_group *nvmet_ns_make(structconfig_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;
Quoted 8 lines
drivers/nvme/target/configfs.c static struct config_group *nvmet_ns_make(struct · line 596
Quoted 1 line
drivers/nvme/target/configfs.c +0
-0????? ns = nvmet_ns_alloc(subsys, nsid);If Linux users want to figure out which code reported an error message they sometimes run grep over the Linux kernel source code. Seeing the above message makes me wonder whether enough context information is provided to allow users to figure out unambiguously which code reported the error message? Have you considered to include the function name in the error message?
It would also be nice to see a device or namespace name, if available.
Quoted 11 lines
Thanks,
Bart.
_______________________________________________
Linux-nvme mailing list
Linux-nvme at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
PATCH 1/1 nvmet: print a hint while rejecting NSID 0 or 0xffffffff
In reply to Bart Van AsscheQuoted 30 lines · Bart Van Assche
Quoted 29 lines · Mikhail Skorzhinskii
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 at solarflare.com>---
?drivers/nvme/target/configfs.c| 4 +++-
? 1 file changed, 3 insertions(+), 1 deletion(-)drivers/nvme/target/configfs.c +3
-1@@ -588,8 +588,10 @@ static struct config_group *nvmet_ns_make(structconfig_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;
Quoted 8 lines
drivers/nvme/target/configfs.c static struct config_group *nvmet_ns_make(struct · line 596
Quoted 1 line
drivers/nvme/target/configfs.c +0
-0????? ns = nvmet_ns_alloc(subsys, nsid);If Linux users want to figure out which code reported an error message they sometimes run grep over the Linux kernel source code. Seeing the above message makes me wonder whether enough context information is provided to allow users to figure out unambiguously which code reported the error message? Have you considered to include the function name in the error message
It looks like 'pr_fmt' is set in this file so the module name will at least be identified.
Quoted 10 lines
Thanks,
Bart.
_______________________________________________
Linux-nvme mailing list
Linux-nvme at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
PATCH 1/1 nvmet: print a hint while rejecting NSID 0 or 0xffffffff
In reply to Bart Van AsscheQuoted 6 lines · Bart Van Assche
If Linux users want to figure out which code reported an error message they sometimes run grep over the Linux kernel source code. Seeing the above message makes me wonder whether enough context information is provided to allow users to figure out unambiguously which code reported the error message? Have you considered to include the function name in the error message?
Bart,
I can see some pr_err() with __func__ being printed out in other drivers, but I just wonder if error messages with the function name itself have been a tradition for the linux kernel project.
Is there somewhere to find out these kind of standard or something? Or If you don't mind, can I ask your advices based on your experience on kernel?
Thanks,
Sagi Grimberg
maintainerPATCH 1/1 nvmet: print a hint while rejecting NSID 0 or 0xffffffff
In reply to Bart Van AsscheQuoted 16 lines
Quoted 16 lines
drivers/nvme/target/configfs.c +3
-1@@ -588,8 +588,10 @@ static struct config_group *nvmet_ns_make(structconfig_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;
Quoted 8 lines
drivers/nvme/target/configfs.c static struct config_group *nvmet_ns_make(struct · line 596
Quoted 1 line
drivers/nvme/target/configfs.c +0
-0????? ns = nvmet_ns_alloc(subsys, nsid);If Linux users want to figure out which code reported an error message they sometimes run grep over the Linux kernel source code. Seeing the above message makes me wonder whether enough context information is provided to allow users to figure out unambiguously which code reported the error message? Have you considered to include the function name in the error message?
I don't think we need that, the same argument can be made for almost any error print, and its pretty obvious that this is the ns creation failure.
The location can be retrieved from:
grep -rIn "invalid nsid" drivers/nvme/target/
Sagi Grimberg
maintainerPATCH 1/1 nvmet: print a hint while rejecting NSID 0 or 0xffffffff
In reply to Mikhail SkorzhinskiiPATCH 1/1 nvmet: print a hint while rejecting NSID 0 or 0xffffffff
In reply to Mikhail SkorzhinskiiThanks,
applied to nvme-5.3.