summaryrefslogtreecommitdiffstats
path: root/drivers/target
diff options
context:
space:
mode:
authorDavid Disseldorp <ddiss@suse.de>2015-07-23 22:33:21 +0200
committerNicholas Bellinger <nab@linux-iscsi.org>2015-07-31 00:22:23 -0700
commitab81a5e0660a058c2cc728fc114fa3082be78952 (patch)
tree3dcb29770448db7e1a68024cb5f72816c4d18eb3 /drivers/target
parent915270c3cacfc80cb3fe7fdd8130439039a85bbb (diff)
downloadop-kernel-dev-ab81a5e0660a058c2cc728fc114fa3082be78952.zip
op-kernel-dev-ab81a5e0660a058c2cc728fc114fa3082be78952.tar.gz
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 <ddiss@suse.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r--drivers/target/target_core_sbc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/target/target_core_sbc.c b/drivers/target/target_core_sbc.c
index 4fc8343..0b4b2a6 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..
OpenPOWER on IntegriCloud