On Thu, May 25, 2017 at 11:43:14AM -0700, Bart Van Assche wrote: > 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. Is it possible we could catch this earlier and avoid giving out the layout in the first place? --b. > > References: commit 82ed4db499b8 ("block: split scsi_request out of struct request") > Signed-off-by: Bart Van Assche <bart.vanassche@xxxxxxxxxxx> > Reviewed-by: Hannes Reinecke <hare@xxxxxxxx> > Cc: J. Bruce Fields <bfields@xxxxxxxxxxxx> > Cc: Jeff Layton <jlayton@xxxxxxxxxxxxxxx> > Cc: Jens Axboe <axboe@xxxxxx> > Cc: Christoph Hellwig <hch@xxxxxx> > Cc: Omar Sandoval <osandov@xxxxxx> > Cc: linux-nfs@xxxxxxxxxxxxxxx > Cc: linux-block@xxxxxxxxxxxxxxx > --- > fs/nfsd/blocklayout.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/fs/nfsd/blocklayout.c b/fs/nfsd/blocklayout.c > index fb5213afc854..38e14cf7e74a 100644 > --- a/fs/nfsd/blocklayout.c > +++ b/fs/nfsd/blocklayout.c > @@ -219,6 +219,9 @@ static int nfsd4_scsi_identify_device(struct block_device *bdev, > u8 *buf, *d, type, assoc; > int error; > > + if (WARN_ON_ONCE(!blk_queue_scsi_pdu(q))) > + return -EINVAL; > + > buf = kzalloc(bufflen, GFP_KERNEL); > if (!buf) > return -ENOMEM; > -- > 2.12.2 -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html