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

Commit ab81a5e0 authored by David Disseldorp's avatar David Disseldorp Committed by Nicholas Bellinger
Browse files

target: check DPO/FUA usage for COMPARE AND WRITE



COMPARE AND WRITE requests should fail if DPO or FUA is set, but the
device is not advertising support.

Signed-off-by: default avatarDavid Disseldorp <ddiss@suse.de>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent 915270c3
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -992,6 +992,9 @@ sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops)
			       " than 1\n", sectors);
			       " than 1\n", sectors);
			return TCM_INVALID_CDB_FIELD;
			return TCM_INVALID_CDB_FIELD;
		}
		}
		if (sbc_check_dpofua(dev, cmd, cdb))
			return TCM_INVALID_CDB_FIELD;

		/*
		/*
		 * Double size because we have two buffers, note that
		 * Double size because we have two buffers, note that
		 * zero is not an error..
		 * zero is not an error..