public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: storvsc: set max_segment_size as UINT_MAX explicitly
@ 2025-06-16 16:05 Ming Lei
  2025-06-16 16:18 ` Bart Van Assche
                   ` (6 more replies)
  0 siblings, 7 replies; 11+ messages in thread
From: Ming Lei @ 2025-06-16 16:05 UTC (permalink / raw)
  To: Martin K . Petersen, linux-scsi
  Cc: linux-block, Ming Lei, K. Y. Srinivasan, Haiyang Zhang, Wei Liu,
	Christoph Hellwig, Ewan D. Milne, Laurence Oberman

Set max_segment_size as UINT_MAX explicitly:

- storvrc uses virt_boundary to define `segment`

- strovrc does not define max_segment_size

So define max_segment_size as UINT_MAX, otherwise __blk_rq_map_sg() takes
default 64K max segment size and splits one virtual segment into two parts,
then breaks virt_boundary limit.

Before commit ec84ca4025c0 ("scsi: block: Remove now unused queue limits helpers"),
max segment size is set as UINT_MAX in case that virt_boundary is
defined.

Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Wei Liu <wei.liu@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Ewan D. Milne <emilne@redhat.com>
Cc: Laurence Oberman <loberman@redhat.com>
Fixes: ec84ca4025c0 ("scsi: block: Remove now unused queue limits helpers")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
---
 drivers/scsi/storvsc_drv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 2e6b2412d2c9..1e7ad85f4ba3 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -1897,6 +1897,7 @@ static struct scsi_host_template scsi_driver = {
 	.no_write_same =	1,
 	.track_queue_depth =	1,
 	.change_queue_depth =	storvsc_change_queue_depth,
+	.max_segment_size   = 0xffffffff,
 };
 
 enum {
-- 
2.47.0


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

end of thread, other threads:[~2025-06-21  0:12 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-16 16:05 [PATCH] scsi: storvsc: set max_segment_size as UINT_MAX explicitly Ming Lei
2025-06-16 16:18 ` Bart Van Assche
2025-06-16 18:51 ` Wei Liu
2025-06-16 21:56 ` Martin K. Petersen
2025-06-17  4:43 ` Christoph Hellwig
2025-06-17  5:02 ` Christoph Hellwig
2025-06-17  7:25   ` Ming Lei
2025-06-18  5:44     ` Christoph Hellwig
2025-06-21  0:12   ` Laurence Oberman
2025-06-17 13:58 ` Laurence Oberman
2025-06-18  5:48 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox