From: David Disseldorp Date: Thu, 23 Jul 2015 20:33:21 +0000 (+0200) Subject: target: check DPO/FUA usage for COMPARE AND WRITE X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ab81a5e0660a058c2cc728fc114fa3082be78952;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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: David Disseldorp Signed-off-by: Nicholas Bellinger --- diff --git a/drivers/target/target_core_sbc.c b/drivers/target/target_core_sbc.c index 4fc8343786f2..0b4b2a67d9f9 100644 --- a/drivers/target/target_core_sbc.c +++ b/drivers/target/target_core_sbc.c @@ -992,6 +992,9 @@ sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops) " than 1\n", sectors); 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 * zero is not an error..