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

Commit 818b571c authored by Nicholas Bellinger's avatar Nicholas Bellinger Committed by Nicholas Bellinger
Browse files

target: Add TCM_MISCOMPARE_VERIFY sense handling



This patch adds TCM_MISCOMPARE_VERIFY (ASC=0x1d, ASCQ=0x00) sense
handling to transport_send_check_condition_and_sense(), which is
required for a COMPARE_AND_WRITE comparision failure.

Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Martin Petersen <martin.petersen@oracle.com>
Cc: Chris Mason <chris.mason@fusionio.com>
Cc: James Bottomley <JBottomley@Parallels.com>
Cc: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: default avatarNicholas Bellinger <nab@daterainc.com>
parent a6b0133c
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -2791,6 +2791,15 @@ transport_send_check_condition_and_sense(struct se_cmd *cmd,
		buffer[SPC_ASC_KEY_OFFSET] = asc;
		buffer[SPC_ASCQ_KEY_OFFSET] = ascq;
		break;
	case TCM_MISCOMPARE_VERIFY:
		/* CURRENT ERROR */
		buffer[0] = 0x70;
		buffer[SPC_ADD_SENSE_LEN_OFFSET] = 10;
		buffer[SPC_SENSE_KEY_OFFSET] = MISCOMPARE;
		/* MISCOMPARE DURING VERIFY OPERATION */
		buffer[SPC_ASC_KEY_OFFSET] = 0x1d;
		buffer[SPC_ASCQ_KEY_OFFSET] = 0x00;
		break;
	case TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE:
	default:
		/* CURRENT ERROR */
+1 −0
Original line number Diff line number Diff line
@@ -197,6 +197,7 @@ enum tcm_sense_reason_table {
	TCM_ADDRESS_OUT_OF_RANGE		= R(0x11),
	TCM_OUT_OF_RESOURCES			= R(0x12),
	TCM_PARAMETER_LIST_LENGTH_ERROR		= R(0x13),
	TCM_MISCOMPARE_VERIFY			= R(0x14),
#undef R
};