nvme: add error message on mismatching controller ids
PATCH 1/1 nvme: add error message on mismatching controller ids
We've seen a few devices that return different controller id's to the Fabric Connect command vs the Identify(controller) command. It's currently hard to identify this failure by existing error messages. It comes across as a (re)connect attempt in the transport that fails with a -22 (-EINVAL) status. The issue is compounded by older kernels not having the controller id check or had the identify command overwrite the fabrics controller id value before it checked. Both resulted in cases where the devices appeared fine until more recent kernels.
Clarify the reject by adding an error message on controller id mismatches.
--- drivers/nvme/host/core.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/nvme/host/core.c +4 -0
@@ -2824,6 +2824,10 @@ int nvme_init_identify(struct nvme_ctrl *ctrl)* admin connect */ if (ctrl->cntlid !=le16_to_cpu (id->cntlid)) { +dev_err (ctrl->device, +"Mismatching cntlid: Connect %u vs Identify " +"%u, rejecting\n" , + ctrl->cntlid,le16_to_cpu (id->cntlid)); ret = -EINVAL ; goto out_free; }
Signature · 7 lines
2.13.7 _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
Quoted 23 lines · James Smart
We've seen a few devices that return different controller id's to the Fabric Connect command vs the Identify(controller) command. It's currently hard to identify this failure by existing error messages. It comes across as a (re)connect attempt in the transport that fails with a -22 (
-EINVAL) status. The issue is compounded by older kernels not having the controller id check or had the identify command overwrite the fabrics controller id value before it checked. Both resulted in cases where the devices appeared fine until more recent kernels.Clarify the reject by adding an error message on controller id mismatches.
Signed-off-by James Smart <[email protected]>--- drivers/nvme/host/core.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/nvme/host/core.c +0
-0
drivers/nvme/host/core.c int nvme_init_identify(struct nvme_ctrl *ctrl) · line 2833
Quoted 10 lines
drivers/nvme/host/core.c +4
-0@@ -2824,6 +2824,10 @@ int nvme_init_identify(struct nvme_ctrl *ctrl)* admin connect */ if (ctrl->cntlid !=le16_to_cpu (id->cntlid)) { +dev_err (ctrl->device, +"Mismatching cntlid: Connect %u vs Identify " +"%u, rejecting\n" , + ctrl->cntlid,le16_to_cpu (id->cntlid)); ret = -EINVAL ; goto out_free; }
Yes please. More than one storage vendor has run into this.
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Looks good to me, just one nit with the commit message and can be applied at the time of applying patch.
Quoted 10 lines · James Smart
We've seen a few devices that return different controller id's to the Fabric Connect command vs the Identify(controller) command. It's currently hard to identify this failure by existing error messages. It comes across as a (re)connect attempt in the transport that fails with a -22 (
-EINVAL) status. The issue is compounded by older kernels not having the controller id check or had the identify command overwrite the fabrics controller id value before it checked. Both resulted in cases where the devices appeared fine until more recent kernels.
Quoted 2 lines
Clarify the reject by adding an error message on controller id mismatches.
When I applied this patch found that there is still some room so we can get to the 72 columns (unless it is done with some purpose) for the commit message, I've just adjusted the lines without changing any description :-
We've seen a few devices that return different controller id's to the Fabric Connect command vs the Identify(controller) command. It's currently hard to identify this failure by existing error messages. It comes across as a (re)connect attempt in the transport that fails with a -22 (-EINVAL) status. The issue is compounded by older kernels not having the controller id check or had the identify command overwrite the fabrics controller id value before it checked. Both resulted in cases where the devices appeared fine until more recent kernels.
Clarify the reject by adding an error message on controller id mismatches.
Quoted 12 lines
Signed-off-by James Smart <[email protected]>--- drivers/nvme/host/core.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/nvme/host/core.c +0
-0
drivers/nvme/host/core.c int nvme_init_identify(struct nvme_ctrl *ctrl) · line 2833
Quoted 10 lines
drivers/nvme/host/core.c +4
-0@@ -2824,6 +2824,10 @@ int nvme_init_identify(struct nvme_ctrl *ctrl)* admin connect */ if (ctrl->cntlid !=le16_to_cpu (id->cntlid)) { +dev_err (ctrl->device, +"Mismatching cntlid: Connect %u vs Identify " +"%u, rejecting\n" , + ctrl->cntlid,le16_to_cpu (id->cntlid)); ret = -EINVAL ; goto out_free; }
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Quoted 24 lines · James Smart
We've seen a few devices that return different controller id's to the Fabric Connect command vs the Identify(controller) command. It's currently hard to identify this failure by existing error messages. It comes across as a (re)connect attempt in the transport that fails with a -22 (
-EINVAL) status. The issue is compounded by older kernels not having the controller id check or had the identify command overwrite the fabrics controller id value before it checked. Both resulted in cases where the devices appeared fine until more recent kernels.Clarify the reject by adding an error message on controller id mismatches.
Signed-off-by James Smart <[email protected]>--- drivers/nvme/host/core.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/nvme/host/core.c +0
-0
drivers/nvme/host/core.c int nvme_init_identify(struct nvme_ctrl *ctrl) · line 2833
Quoted 10 lines
drivers/nvme/host/core.c +4
-0@@ -2824,6 +2824,10 @@ int nvme_init_identify(struct nvme_ctrl *ctrl)* admin connect */ if (ctrl->cntlid !=le16_to_cpu (id->cntlid)) { +dev_err (ctrl->device, +"Mismatching cntlid: Connect %u vs Identify " +"%u, rejecting\n" , + ctrl->cntlid,le16_to_cpu (id->cntlid)); ret = -EINVAL ; goto out_free; }
Indeed, we've seem them too.
Cheers,
Hannes
Signature · 9 lines
Dr. Hannes Reinecke Teamlead Storage & Networking [email protected] +49 911 74053 688 SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), GF: Felix Imendörffer _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
Looks good (modulo the commit message nitpicks):
_______________________________________________
linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Applied to nvme/for-5.5 with the minor word-wrap adjustment on the commit log.
_______________________________________________
linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme