target: allow underflow/overflow for PR OUT etc. commands
Subsystems (2)
PATCH 1/1 target: allow underflow/overflow for PR OUT etc. commands
From: Roland Dreier <[email protected]>
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.
--- drivers/target/target_core_transport.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/target/target_core_transport.c +3 -3
@@ -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 ; }/*
Signature · 1 line
2.5.0.rc3
Looks good,
(altough normal Linux style would be to add parenthesis around the logial and)
Nicholas A. Bellinger
AppliedQuoted 21 lines · Spencer Baugh
From: Roland Dreier <[email protected]>
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_DLfield), so allow these commands. The Windows compliance test sends them.Signed-off-by Roland Dreier <[email protected]>Signed-off-by Spencer Baugh <[email protected]>--- drivers/target/target_core_transport.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/target/target_core_transport.c +0
-0@@ -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]);
drivers/target/target_core_transport.c target_cmd_size_check(struct se_cmd *cmd, unsigned int size) · line 1095
Quoted 10 lines
drivers/target/target_core_transport.c +3
-3-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.