* [PATCH] target: improve unsupported opcode message
@ 2015-07-22 22:01 Spencer Baugh
2015-07-23 9:39 ` Christoph Hellwig
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Spencer Baugh @ 2015-07-22 22:01 UTC (permalink / raw)
To: Nicholas A. Bellinger, open list:TARGET SUBSYSTEM,
open list:TARGET SUBSYSTEM, open list
Cc: Joern Engel, Spencer Baugh, Spencer Baugh
From: Joern Engel <joern@purestorage.com>
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.
Signed-off-by: Joern Engel <joern@purestorage.com>
Signed-off-by: Spencer Baugh <sbaugh@catern.com>
---
drivers/target/target_core_spc.c | 3 ---
drivers/target/target_core_transport.c | 5 +++++
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/target/target_core_spc.c b/drivers/target/target_core_spc.c
index b074443..87d4adb 100644
--- a/drivers/target/target_core_spc.c
+++ b/drivers/target/target_core_spc.c
@@ -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;
}
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index ce8574b..ac002a7 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -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;
--
2.5.0.rc3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] target: improve unsupported opcode message
2015-07-22 22:01 [PATCH] target: improve unsupported opcode message Spencer Baugh
@ 2015-07-23 9:39 ` Christoph Hellwig
2015-07-23 9:57 ` Sagi Grimberg
2015-07-31 6:46 ` Nicholas A. Bellinger
2 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2015-07-23 9:39 UTC (permalink / raw)
To: Spencer Baugh
Cc: Nicholas A. Bellinger, open list:TARGET SUBSYSTEM,
open list:TARGET SUBSYSTEM, open list, Joern Engel, Spencer Baugh
Looks good,
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] target: improve unsupported opcode message
2015-07-22 22:01 [PATCH] target: improve unsupported opcode message Spencer Baugh
2015-07-23 9:39 ` Christoph Hellwig
@ 2015-07-23 9:57 ` Sagi Grimberg
2015-07-31 6:46 ` Nicholas A. Bellinger
2 siblings, 0 replies; 4+ messages in thread
From: Sagi Grimberg @ 2015-07-23 9:57 UTC (permalink / raw)
To: Spencer Baugh, Nicholas A. Bellinger, open list:TARGET SUBSYSTEM,
open list:TARGET SUBSYSTEM, open list
Cc: Joern Engel, Spencer Baugh
On 7/23/2015 1:01 AM, Spencer Baugh wrote:
> From: Joern Engel <joern@purestorage.com>
>
> 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.
>
> Signed-off-by: Joern Engel <joern@purestorage.com>
> Signed-off-by: Spencer Baugh <sbaugh@catern.com>
Looks good,
Reviewed-by: Sagi Grimberg <sagig@mellanox.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] target: improve unsupported opcode message
2015-07-22 22:01 [PATCH] target: improve unsupported opcode message Spencer Baugh
2015-07-23 9:39 ` Christoph Hellwig
2015-07-23 9:57 ` Sagi Grimberg
@ 2015-07-31 6:46 ` Nicholas A. Bellinger
2 siblings, 0 replies; 4+ messages in thread
From: Nicholas A. Bellinger @ 2015-07-31 6:46 UTC (permalink / raw)
To: Spencer Baugh
Cc: open list:TARGET SUBSYSTEM, open list:TARGET SUBSYSTEM, open list,
Joern Engel, Spencer Baugh
On Wed, 2015-07-22 at 15:01 -0700, Spencer Baugh wrote:
> From: Joern Engel <joern@purestorage.com>
>
> 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.
>
> Signed-off-by: Joern Engel <joern@purestorage.com>
> Signed-off-by: Spencer Baugh <sbaugh@catern.com>
> ---
> drivers/target/target_core_spc.c | 3 ---
> drivers/target/target_core_transport.c | 5 +++++
> 2 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/target/target_core_spc.c b/drivers/target/target_core_spc.c
> index b074443..87d4adb 100644
> --- a/drivers/target/target_core_spc.c
> +++ b/drivers/target/target_core_spc.c
> @@ -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;
> }
>
> diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
> index ce8574b..ac002a7 100644
> --- a/drivers/target/target_core_transport.c
> +++ b/drivers/target/target_core_transport.c
> @@ -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;
>
Applied to target-pending/for-next.
Thanks Joern + Spencer!
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-07-31 6:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-22 22:01 [PATCH] target: improve unsupported opcode message Spencer Baugh
2015-07-23 9:39 ` Christoph Hellwig
2015-07-23 9:57 ` Sagi Grimberg
2015-07-31 6:46 ` Nicholas A. Bellinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox