From: Hannes Reinecke Subject: Re: [PATCH 15/31] nfsd: Check private request size before submitting a SCSI request Date: Wed, 24 May 2017 08:02:49 +0200 Message-ID: References: <20170524003420.5381-1-bart.vanassche@sandisk.com> <20170524003420.5381-16-bart.vanassche@sandisk.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: <20170524003420.5381-16-bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org> Content-Language: en-US Sender: linux-nfs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Bart Van Assche , "Martin K . Petersen" , James Bottomley Cc: linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-block-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, "J . Bruce Fields" , Jeff Layton , Jens Axboe , Christoph Hellwig , Omar Sandoval , Hannes Reinecke , linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-scsi@vger.kernel.org On 05/24/2017 02:34 AM, 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. > > References: commit 82ed4db499b8 ("block: split scsi_request out of struct request") > Signed-off-by: Bart Van Assche > Cc: J. Bruce Fields > Cc: Jeff Layton > Cc: Jens Axboe > Cc: Christoph Hellwig > Cc: Omar Sandoval > Cc: Hannes Reinecke > Cc: linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > Cc: linux-block-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > --- > fs/nfsd/blocklayout.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/fs/nfsd/blocklayout.c b/fs/nfsd/blocklayout.c > index fb5213afc854..9ca0ca5efbc8 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_sup(q))) > + return -EINVAL; > + > buf = kzalloc(bufflen, GFP_KERNEL); > if (!buf) > return -ENOMEM; > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking hare-l3A5Bk7waGM@public.gmane.org +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg) -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html