diff options
author | Christoph Hellwig <hch@lst.de> | 2015-05-22 05:12:45 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2015-05-22 10:36:44 -0400 |
commit | 772ce43559e076730ddff5907fabcb3485545e38 (patch) | |
tree | 20169504b9f11360f720a7d90d00601458c0ecf1 /drivers/block | |
parent | 908517684807f3b3d93893da78c7906f5ff2c49b (diff) |
nvme: fail SCSI read/write command with unsupported protection bit
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/nvme-scsi.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/block/nvme-scsi.c b/drivers/block/nvme-scsi.c index f53da60b657d..342f5b7f840d 100644 --- a/drivers/block/nvme-scsi.c +++ b/drivers/block/nvme-scsi.c | |||
@@ -1900,6 +1900,13 @@ static int nvme_trans_io(struct nvme_ns *ns, struct sg_io_hdr *hdr, u8 is_write, | |||
1900 | default: | 1900 | default: |
1901 | cdb_info.fua = cmd[1] & 0x8; | 1901 | cdb_info.fua = cmd[1] & 0x8; |
1902 | cdb_info.prot_info = (cmd[1] & 0xe0) >> 5; | 1902 | cdb_info.prot_info = (cmd[1] & 0xe0) >> 5; |
1903 | if (cdb_info.prot_info && !ns->pi_type) { | ||
1904 | return nvme_trans_completion(hdr, | ||
1905 | SAM_STAT_CHECK_CONDITION, | ||
1906 | ILLEGAL_REQUEST, | ||
1907 | SCSI_ASC_INVALID_CDB, | ||
1908 | SCSI_ASCQ_CAUSE_NOT_REPORTABLE); | ||
1909 | } | ||
1903 | } | 1910 | } |
1904 | 1911 | ||
1905 | switch (opcode) { | 1912 | switch (opcode) { |