aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Dreier <roland@purestorage.com>2015-07-22 18:08:18 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2015-07-31 02:41:16 -0400
commitc72c5250224d475614a00c1d7e54a67f77cd3410 (patch)
tree27b7ac8c05d32b12750a1076447da71d25226593
parentaa75679c797c0250a853e600e45368f1f9545c27 (diff)
target: allow underflow/overflow for PR OUT etc. commands
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> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
-rw-r--r--drivers/target/target_core_transport.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index 98155db28365..729ec7345e99 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -1088,9 +1088,9 @@ target_cmd_size_check(struct se_cmd *cmd, unsigned int size)
1088 " 0x%02x\n", cmd->se_tfo->get_fabric_name(), 1088 " 0x%02x\n", cmd->se_tfo->get_fabric_name(),
1089 cmd->data_length, size, cmd->t_task_cdb[0]); 1089 cmd->data_length, size, cmd->t_task_cdb[0]);
1090 1090
1091 if (cmd->data_direction == DMA_TO_DEVICE) { 1091 if (cmd->data_direction == DMA_TO_DEVICE &&
1092 pr_err("Rejecting underflow/overflow" 1092 cmd->se_cmd_flags & SCF_SCSI_DATA_CDB) {
1093 " WRITE data\n"); 1093 pr_err("Rejecting underflow/overflow WRITE data\n");
1094 return TCM_INVALID_CDB_FIELD; 1094 return TCM_INVALID_CDB_FIELD;
1095 } 1095 }
1096 /* 1096 /*