target: improve unsupported opcode message
Subsystems (2)
PATCH 1/1 target: improve unsupported opcode message
From: Joern Engel <[email protected]>
Make the warning about unsupported SCSI opcode more useful:
- Add in the initiator name so we know who's sending it.
- Print the warning even for opcodes that spc_parse_cdb() knows about but that we don't handle.
--- drivers/target/target_core_spc.c | 3 --- drivers/target/target_core_transport.c | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-)
drivers/target/target_core_spc.c +0 -3
@@ -1405,9 +1405,6 @@ spc_parse_cdb(struct se_cmd *cmd, unsigned int *size) }break ;default : -pr_warn ("TARGET_CORE[%s]: Unsupported SCSI Opcode" -" 0x%02x, sending CHECK_CONDITION.\n" , - cmd->se_tfo->get_fabric_name (), cdb[0 ]);return TCM_UNSUPPORTED_SCSI_OPCODE ; }
drivers/target/target_core_transport.c +5 -0
@@ -1246,6 +1246,11 @@ target_setup_cmd_from_cdb(struct se_cmd *cmd, unsigned char *cdb) } ret = dev->transport->parse_cdb (cmd); +if (ret ==TCM_UNSUPPORTED_SCSI_OPCODE ) +pr_warn_ratelimited ("%s/%s: Unsupported SCSI Opcode 0x%02x, sending CHECK_CONDITION.\n" , + cmd->se_tfo->get_fabric_name (), + cmd->se_sess->se_node_acl->initiatorname, + cmd->t_task_cdb[0 ]);if (ret)return ret;
Signature · 1 line
2.5.0.rc3
Looks good,
Quoted 10 lines · Spencer Baugh
From: Joern Engel <[email protected]>
Make the warning about unsupported SCSI opcode more useful:
- Add in the initiator name so we know who's sending it.
- Print the warning even for opcodes thatspc_parse_cdb()knows about but that we don't handle.Signed-off-by Joern Engel <[email protected]>Signed-off-by Spencer Baugh <[email protected]>
Looks good,
Nicholas A. Bellinger
AppliedQuoted 35 lines · Spencer Baugh
From: Joern Engel <[email protected]>
Make the warning about unsupported SCSI opcode more useful:
- Add in the initiator name so we know who's sending it.
- Print the warning even for opcodes thatspc_parse_cdb()knows about but that we don't handle.Signed-off-by Joern Engel <[email protected]>Signed-off-by Spencer Baugh <[email protected]>--- drivers/target/target_core_spc.c | 3 --- drivers/target/target_core_transport.c | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-)drivers/target/target_core_spc.c +0
-3@@ -1405,9 +1405,6 @@ spc_parse_cdb(struct se_cmd *cmd, unsigned int *size) }break ;default : -pr_warn ("TARGET_CORE[%s]: Unsupported SCSI Opcode" -" 0x%02x, sending CHECK_CONDITION.\n" , - cmd->se_tfo->get_fabric_name (), cdb[0 ]);return TCM_UNSUPPORTED_SCSI_OPCODE ; }drivers/target/target_core_transport.c +0
-0@@ -1246,6 +1246,11 @@ target_setup_cmd_from_cdb(struct se_cmd *cmd, unsigned char *cdb) }
drivers/target/target_core_transport.c target_setup_cmd_from_cdb(struct se_cmd *cmd, unsigned char *cdb) · line 1256
Quoted 10 lines
drivers/target/target_core_transport.c +5
-0ret = dev->transport->parse_cdb (cmd); +if (ret ==TCM_UNSUPPORTED_SCSI_OPCODE ) +pr_warn_ratelimited ("%s/%s: Unsupported SCSI Opcode 0x%02x, sending CHECK_CONDITION.\n" , + cmd->se_tfo->get_fabric_name (), + cmd->se_sess->se_node_acl->initiatorname, + cmd->t_task_cdb[0 ]);if (ret)return ret;
Applied to target-pending/for-next.
Thanks Joern + Spencer!