mirror of
https://github.com/torvalds/linux.git
synced 2024-11-12 07:01:57 +00:00
target: Fail WRITE_SAME w/ UNMAP=1 when emulate_tpws=0
This patch adds a check within sbc_setup_write_same() to fail a WRITE_SAME w/ UNMAP=1 op, if the backend device has emulate_tpws disabled. Cc: Martin Petersen <martin.petersen@oracle.com> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
This commit is contained in:
parent
fde9f50f80
commit
d0a9129555
@ -293,6 +293,11 @@ sbc_setup_write_same(struct se_cmd *cmd, unsigned char *flags, struct sbc_ops *o
|
|||||||
if (!ops->execute_write_same_unmap)
|
if (!ops->execute_write_same_unmap)
|
||||||
return TCM_UNSUPPORTED_SCSI_OPCODE;
|
return TCM_UNSUPPORTED_SCSI_OPCODE;
|
||||||
|
|
||||||
|
if (!dev->dev_attrib.emulate_tpws) {
|
||||||
|
pr_err("Got WRITE_SAME w/ UNMAP=1, but backend device"
|
||||||
|
" has emulate_tpws disabled\n");
|
||||||
|
return TCM_UNSUPPORTED_SCSI_OPCODE;
|
||||||
|
}
|
||||||
cmd->execute_cmd = ops->execute_write_same_unmap;
|
cmd->execute_cmd = ops->execute_write_same_unmap;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user