target: Fail I/O with PROTECT bit when protection is unsupported
authorNicholas Bellinger <nab@linux-iscsi.org>
Fri, 13 Feb 2015 22:49:38 +0000 (22:49 +0000)
committerNicholas Bellinger <nab@linux-iscsi.org>
Sat, 14 Feb 2015 02:09:44 +0000 (02:09 +0000)
This patch adds an explicit check for WRPROTECT + RDPROTECT bit usage
within sbc_check_prot(), and fails with TCM_INVALID_CDB_FIELD if the
backend device does not have protection enabled.

Also, update sbc_check_prot() to return sense_reason_t in order to
propigate up the correct sense ASQ.

Cc: Martin Petersen <martin.petersen@oracle.com>
Cc: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_sbc.c

Simple merge