target: Fail UNMAP when emulate_tpu=0
This patch adds a check within sbc_parse_cdb() to fail a UNMAP op, if the backend device has emulate_tpu 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
d0a9129555
commit
61fdb4acc8
|
@ -962,6 +962,11 @@ sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops)
|
|||
if (!ops->execute_unmap)
|
||||
return TCM_UNSUPPORTED_SCSI_OPCODE;
|
||||
|
||||
if (!dev->dev_attrib.emulate_tpu) {
|
||||
pr_err("Got UNMAP, but backend device has"
|
||||
" emulate_tpu disabled\n");
|
||||
return TCM_UNSUPPORTED_SCSI_OPCODE;
|
||||
}
|
||||
size = get_unaligned_be16(&cdb[7]);
|
||||
cmd->execute_cmd = ops->execute_unmap;
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue