Skip to content

Commit

Permalink
nvme: fail SCSI read/write command with unsupported protection bit
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
  • Loading branch information
Christoph Hellwig authored and Jens Axboe committed May 22, 2015
1 parent 9085176 commit 772ce43
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/block/nvme-scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1900,6 +1900,13 @@ static int nvme_trans_io(struct nvme_ns *ns, struct sg_io_hdr *hdr, u8 is_write,
default:
cdb_info.fua = cmd[1] & 0x8;
cdb_info.prot_info = (cmd[1] & 0xe0) >> 5;
if (cdb_info.prot_info && !ns->pi_type) {
return nvme_trans_completion(hdr,
SAM_STAT_CHECK_CONDITION,
ILLEGAL_REQUEST,
SCSI_ASC_INVALID_CDB,
SCSI_ASCQ_CAUSE_NOT_REPORTABLE);
}
}

switch (opcode) {
Expand Down

0 comments on commit 772ce43

Please sign in to comment.