All of lore.kernel.org
 help / color / mirror / Atom feed
From: "J . Bruce Fields" <bfields@fieldses.org>
To: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	Jeff Layton <jlayton@poochiereds.net>,
	Omar Sandoval <osandov@fb.com>,
	linux-nfs@vger.kernel.org
Subject: Re: [PATCH v2 6/6] nfsd: Check queue type before submitting a SCSI request
Date: Thu, 1 Jun 2017 09:29:27 -0400	[thread overview]
Message-ID: <20170601132927.GO18523@fieldses.org> (raw)
In-Reply-To: <20170531214350.31157-7-bart.vanassche@sandisk.com>

Feel free to add

	Acked-by: J. Bruce Fields <bfields@redhat.com>

if you need it.--b.

On Wed, May 31, 2017 at 02:43:50PM -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.
> 
> References: commit 82ed4db499b8 ("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>
> Cc: J. Bruce Fields <bfields@fieldses.org>
> Cc: Jeff Layton <jlayton@poochiereds.net>
> Cc: Omar Sandoval <osandov@fb.com>
> Cc: linux-nfs@vger.kernel.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..47ed19c53f2e 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_passthrough(q)))
> +		return -EINVAL;
> +
>  	buf = kzalloc(bufflen, GFP_KERNEL);
>  	if (!buf)
>  		return -ENOMEM;
> -- 
> 2.12.2

  reply	other threads:[~2017-06-01 13:29 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-31 21:43 [PATCH v2 0/6] Split scsi passthrough fields out of struct request sequel Bart Van Assche
2017-05-31 21:43 ` [PATCH v2 1/6] block: Avoid that blk_exit_rl() triggers a use-after-free Bart Van Assche
2017-06-01 19:09   ` Jens Axboe
2017-06-13 17:54   ` Ross Zwisler
2017-06-14 15:19     ` Bart Van Assche
2017-06-14 18:04       ` Ross Zwisler
2017-06-14 19:28       ` Jens Axboe
2017-06-14 19:32         ` Bart Van Assche
2017-05-31 21:43 ` [PATCH v2 2/6] block: Introduce queue flag QUEUE_FLAG_SCSI_PASSTHROUGH Bart Van Assche
2017-05-31 21:43 ` [PATCH v2 3/6] bsg: Check queue type before attaching to a queue Bart Van Assche
2017-05-31 21:43 ` [PATCH v2 4/6] pktcdvd: " Bart Van Assche
2017-12-30 21:41   ` [v2,4/6] " Maciej S. Szmigiero
2017-12-31  0:53     ` Bart Van Assche
2017-12-31  1:23       ` Maciej S. Szmigiero
2017-05-31 21:43 ` [PATCH v2 5/6] cdrom: Check SCSI passthrough support before reading audio Bart Van Assche
2017-06-01  5:50   ` Hannes Reinecke
2017-06-01  6:05   ` Christoph Hellwig
2017-05-31 21:43 ` [PATCH v2 6/6] nfsd: Check queue type before submitting a SCSI request Bart Van Assche
2017-06-01 13:29   ` J . Bruce Fields [this message]
2017-06-01  6:05 ` [PATCH v2 0/6] Split scsi passthrough fields out of struct request sequel Christoph Hellwig
2017-06-01 19:11 ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170601132927.GO18523@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=axboe@kernel.dk \
    --cc=bart.vanassche@sandisk.com \
    --cc=hch@lst.de \
    --cc=jlayton@poochiereds.net \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=osandov@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.