Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c72c5250 authored by Roland Dreier's avatar Roland Dreier Committed by Nicholas Bellinger
Browse files

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: default avatarRoland Dreier <roland@purestorage.com>
Signed-off-by: default avatarSpencer Baugh <sbaugh@catern.com>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent aa75679c
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1088,9 +1088,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;
		}
		/*