diff options
author | Roland Dreier <roland@purestorage.com> | 2013-10-14 18:49:23 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-10-16 16:32:07 -0400 |
commit | 5cb770bf4b777dae832151f4bc4d35e7a99f9880 (patch) | |
tree | e0f0b0166f472bfafc99175a1983b4a4316ad7de /drivers/target/target_core_sbc.c | |
parent | 2053a1db41193c2b5e1f47a91aaba0fd63ba7102 (diff) |
target: Return an error for WRITE SAME with ANCHOR==1
Per SBC-3, since we report ANC_SUP==0 in VPD page B2h, we need to return
an error (ILLEGAL REQUEST/INVALID FIELD IN CDB) for all WRITE SAME
requests with ANCHOR==1.
Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/target_core_sbc.c')
-rw-r--r-- | drivers/target/target_core_sbc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/target/target_core_sbc.c b/drivers/target/target_core_sbc.c index 4714c6f8da4b..d9b92b2c524d 100644 --- a/drivers/target/target_core_sbc.c +++ b/drivers/target/target_core_sbc.c | |||
@@ -263,6 +263,11 @@ sbc_setup_write_same(struct se_cmd *cmd, unsigned char *flags, struct sbc_ops *o | |||
263 | sectors, cmd->se_dev->dev_attrib.max_write_same_len); | 263 | sectors, cmd->se_dev->dev_attrib.max_write_same_len); |
264 | return TCM_INVALID_CDB_FIELD; | 264 | return TCM_INVALID_CDB_FIELD; |
265 | } | 265 | } |
266 | /* We always have ANC_SUP == 0 so setting ANCHOR is always an error */ | ||
267 | if (flags[0] & 0x10) { | ||
268 | pr_warn("WRITE SAME with ANCHOR not supported\n"); | ||
269 | return TCM_INVALID_CDB_FIELD; | ||
270 | } | ||
266 | /* | 271 | /* |
267 | * Special case for WRITE_SAME w/ UNMAP=1 that ends up getting | 272 | * Special case for WRITE_SAME w/ UNMAP=1 that ends up getting |
268 | * translated into block discard requests within backend code. | 273 | * translated into block discard requests within backend code. |