* [PATCH] target: allow underflow/overflow for PR OUT etc. commands
@ 2015-07-22 22:08 Spencer Baugh
2015-07-23 9:44 ` Christoph Hellwig
2015-07-31 6:44 ` Nicholas A. Bellinger
0 siblings, 2 replies; 3+ messages in thread
From: Spencer Baugh @ 2015-07-22 22:08 UTC (permalink / raw)
To: Nicholas A. Bellinger, open list:TARGET SUBSYSTEM,
open list:TARGET SUBSYSTEM, open list
Cc: Joern Engel, Spencer Baugh, Roland Dreier, Spencer Baugh
From: Roland Dreier <roland@purestorage.com>
It's not necessarily a fatal error if a command with a data-out phase
has a data length that differs from the transport data length (e.g.
PERSISTENT RESERVE OUT might have a parameter list length in the CDB
that's smaller than the FC_DL field), so allow these commands. The
Windows compliance test sends them.
Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Spencer Baugh <sbaugh@catern.com>
---
drivers/target/target_core_transport.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index ac002a7..f6626bb 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -1087,9 +1087,9 @@ target_cmd_size_check(struct se_cmd *cmd, unsigned int size)
" 0x%02x\n", cmd->se_tfo->get_fabric_name(),
cmd->data_length, size, cmd->t_task_cdb[0]);
- if (cmd->data_direction == DMA_TO_DEVICE) {
- pr_err("Rejecting underflow/overflow"
- " WRITE data\n");
+ if (cmd->data_direction == DMA_TO_DEVICE &&
+ cmd->se_cmd_flags & SCF_SCSI_DATA_CDB) {
+ pr_err("Rejecting underflow/overflow WRITE data\n");
return TCM_INVALID_CDB_FIELD;
}
/*
--
2.5.0.rc3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] target: allow underflow/overflow for PR OUT etc. commands
2015-07-22 22:08 [PATCH] target: allow underflow/overflow for PR OUT etc. commands Spencer Baugh
@ 2015-07-23 9:44 ` Christoph Hellwig
2015-07-31 6:44 ` Nicholas A. Bellinger
1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2015-07-23 9:44 UTC (permalink / raw)
To: Spencer Baugh
Cc: Nicholas A. Bellinger, open list:TARGET SUBSYSTEM,
open list:TARGET SUBSYSTEM, open list, Joern Engel, Spencer Baugh,
Roland Dreier
Looks good,
Reviewed-by: Christoph Hellwig <hch@lst.de>
(altough normal Linux style would be to add parenthesis around the
logial and)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] target: allow underflow/overflow for PR OUT etc. commands
2015-07-22 22:08 [PATCH] target: allow underflow/overflow for PR OUT etc. commands Spencer Baugh
2015-07-23 9:44 ` Christoph Hellwig
@ 2015-07-31 6:44 ` Nicholas A. Bellinger
1 sibling, 0 replies; 3+ messages in thread
From: Nicholas A. Bellinger @ 2015-07-31 6:44 UTC (permalink / raw)
To: Spencer Baugh
Cc: open list:TARGET SUBSYSTEM, open list:TARGET SUBSYSTEM, open list,
Joern Engel, Spencer Baugh, Roland Dreier
On Wed, 2015-07-22 at 15:08 -0700, Spencer Baugh wrote:
> From: Roland Dreier <roland@purestorage.com>
>
> It's not necessarily a fatal error if a command with a data-out phase
> has a data length that differs from the transport data length (e.g.
> PERSISTENT RESERVE OUT might have a parameter list length in the CDB
> that's smaller than the FC_DL field), so allow these commands. The
> Windows compliance test sends them.
>
> Signed-off-by: Roland Dreier <roland@purestorage.com>
> Signed-off-by: Spencer Baugh <sbaugh@catern.com>
> ---
> drivers/target/target_core_transport.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
> index ac002a7..f6626bb 100644
> --- a/drivers/target/target_core_transport.c
> +++ b/drivers/target/target_core_transport.c
> @@ -1087,9 +1087,9 @@ target_cmd_size_check(struct se_cmd *cmd, unsigned int size)
> " 0x%02x\n", cmd->se_tfo->get_fabric_name(),
> cmd->data_length, size, cmd->t_task_cdb[0]);
>
> - if (cmd->data_direction == DMA_TO_DEVICE) {
> - pr_err("Rejecting underflow/overflow"
> - " WRITE data\n");
> + if (cmd->data_direction == DMA_TO_DEVICE &&
> + cmd->se_cmd_flags & SCF_SCSI_DATA_CDB) {
> + pr_err("Rejecting underflow/overflow WRITE data\n");
> return TCM_INVALID_CDB_FIELD;
> }
> /*
Applied to target-pending/for-next.
Thanks Roland & Co.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-07-31 6:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-22 22:08 [PATCH] target: allow underflow/overflow for PR OUT etc. commands Spencer Baugh
2015-07-23 9:44 ` Christoph Hellwig
2015-07-31 6:44 ` 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