Skip to content

Commit 30181fa

Browse files
Bart Van Asscheaxboe
authored andcommitted
nfsd: Check queue type before submitting a SCSI request
Since using scsi_req() is only allowed against request queues for which struct scsi_request is the first member of their private request data, refuse to submit SCSI commands against a queue for which this is not the case. References: commit 82ed4db ("block: split scsi_request out of struct request") Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Acked-by: J. Bruce Fields <bfields@redhat.com> Cc: Jeff Layton <jlayton@poochiereds.net> Cc: Omar Sandoval <osandov@fb.com> Cc: linux-nfs@vger.kernel.org Signed-off-by: Jens Axboe <axboe@fb.com>
1 parent 73d1770 commit 30181fa

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎fs/nfsd/blocklayout.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,9 @@ static int nfsd4_scsi_identify_device(struct block_device *bdev,
219219
u8 *buf, *d, type, assoc;
220220
int error;
221221

222+
if (WARN_ON_ONCE(!blk_queue_scsi_passthrough(q)))
223+
return -EINVAL;
224+
222225
buf = kzalloc(bufflen, GFP_KERNEL);
223226
if (!buf)
224227
return -ENOMEM;

0 commit comments

Comments
 (0)