linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] block: fix max segment size handling in blk_queue_virt_boundary
@ 2019-07-24 16:26 Christoph Hellwig
  2019-07-25  0:31 ` Bob Liu
  2019-07-26  7:35 ` Christoph Hellwig
  0 siblings, 2 replies; 4+ messages in thread
From: Christoph Hellwig @ 2019-07-24 16:26 UTC (permalink / raw)
  To: axboe; +Cc: linux, James.Bottomley, linux-block

We should only set the max segment size to unlimited if we actually
have a virt boundary.  Otherwise we accidentally clear that limit
when called from the SCSI midlayer, which always calls
blk_queue_virt_boundary, even if that mask is 0.

Fixes: 7ad388d8e4c7 ("scsi: core: add a host / host template field for the virt boundary")
Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 block/blk-settings.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/block/blk-settings.c b/block/blk-settings.c
index 2ae348c101a0..2c1831207a8f 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -752,7 +752,8 @@ void blk_queue_virt_boundary(struct request_queue *q, unsigned long mask)
 	 * page (which might not be idential to the Linux PAGE_SIZE).  Because
 	 * of that they are not limited by our notion of "segment size".
 	 */
-	q->limits.max_segment_size = UINT_MAX;
+	if (mask)
+		q->limits.max_segment_size = UINT_MAX;
 }
 EXPORT_SYMBOL(blk_queue_virt_boundary);
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] block: fix max segment size handling in blk_queue_virt_boundary
  2019-07-24 16:26 [PATCH] block: fix max segment size handling in blk_queue_virt_boundary Christoph Hellwig
@ 2019-07-25  0:31 ` Bob Liu
  2019-07-26  7:35 ` Christoph Hellwig
  1 sibling, 0 replies; 4+ messages in thread
From: Bob Liu @ 2019-07-25  0:31 UTC (permalink / raw)
  To: Christoph Hellwig, axboe; +Cc: linux, James.Bottomley, linux-block

On 7/25/19 12:26 AM, Christoph Hellwig wrote:
> We should only set the max segment size to unlimited if we actually
> have a virt boundary.  Otherwise we accidentally clear that limit
> when called from the SCSI midlayer, which always calls
> blk_queue_virt_boundary, even if that mask is 0.
> 
> Fixes: 7ad388d8e4c7 ("scsi: core: add a host / host template field for the virt boundary")
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  block/blk-settings.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/block/blk-settings.c b/block/blk-settings.c
> index 2ae348c101a0..2c1831207a8f 100644
> --- a/block/blk-settings.c
> +++ b/block/blk-settings.c
> @@ -752,7 +752,8 @@ void blk_queue_virt_boundary(struct request_queue *q, unsigned long mask)
>  	 * page (which might not be idential to the Linux PAGE_SIZE).  Because
>  	 * of that they are not limited by our notion of "segment size".
>  	 */
> -	q->limits.max_segment_size = UINT_MAX;
> +	if (mask)
> +		q->limits.max_segment_size = UINT_MAX;
>  }
>  EXPORT_SYMBOL(blk_queue_virt_boundary);
>  

Looks good to me!
Reviewed-by: Bob Liu <bob.liu@oracle.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] block: fix max segment size handling in blk_queue_virt_boundary
  2019-07-24 16:26 [PATCH] block: fix max segment size handling in blk_queue_virt_boundary Christoph Hellwig
  2019-07-25  0:31 ` Bob Liu
@ 2019-07-26  7:35 ` Christoph Hellwig
  2019-07-26 18:52   ` Jens Axboe
  1 sibling, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2019-07-26  7:35 UTC (permalink / raw)
  To: axboe; +Cc: linux, James.Bottomley, linux-block

Jens, can you take a look?  This fixes a boot regression hitting
various people.

On Wed, Jul 24, 2019 at 06:26:56PM +0200, Christoph Hellwig wrote:
> We should only set the max segment size to unlimited if we actually
> have a virt boundary.  Otherwise we accidentally clear that limit
> when called from the SCSI midlayer, which always calls
> blk_queue_virt_boundary, even if that mask is 0.
> 
> Fixes: 7ad388d8e4c7 ("scsi: core: add a host / host template field for the virt boundary")
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  block/blk-settings.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/block/blk-settings.c b/block/blk-settings.c
> index 2ae348c101a0..2c1831207a8f 100644
> --- a/block/blk-settings.c
> +++ b/block/blk-settings.c
> @@ -752,7 +752,8 @@ void blk_queue_virt_boundary(struct request_queue *q, unsigned long mask)
>  	 * page (which might not be idential to the Linux PAGE_SIZE).  Because
>  	 * of that they are not limited by our notion of "segment size".
>  	 */
> -	q->limits.max_segment_size = UINT_MAX;
> +	if (mask)
> +		q->limits.max_segment_size = UINT_MAX;
>  }
>  EXPORT_SYMBOL(blk_queue_virt_boundary);
>  
> -- 
> 2.20.1
---end quoted text---

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] block: fix max segment size handling in blk_queue_virt_boundary
  2019-07-26  7:35 ` Christoph Hellwig
@ 2019-07-26 18:52   ` Jens Axboe
  0 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2019-07-26 18:52 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux, James.Bottomley, linux-block

On 7/26/19 1:35 AM, Christoph Hellwig wrote:
> Jens, can you take a look?  This fixes a boot regression hitting
> various people.

Sorry, totally missed this... Did already send in a pull request
today, but I'll get this applied and out before -rc2.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-07-26 18:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-24 16:26 [PATCH] block: fix max segment size handling in blk_queue_virt_boundary Christoph Hellwig
2019-07-25  0:31 ` Bob Liu
2019-07-26  7:35 ` Christoph Hellwig
2019-07-26 18:52   ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).