public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurence Oberman <loberman@redhat.com>
To: Christoph Hellwig <hch@lst.de>, Ming Lei <ming.lei@redhat.com>
Cc: "Martin K . Petersen" <martin.petersen@oracle.com>,
	 linux-scsi@vger.kernel.org, linux-block@vger.kernel.org,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>, "Ewan D. Milne" <emilne@redhat.com>
Subject: Re: [PATCH] scsi: storvsc: set max_segment_size as UINT_MAX explicitly
Date: Fri, 20 Jun 2025 20:12:15 -0400	[thread overview]
Message-ID: <d122346c3aea794087da7d9f166a412349517503.camel@redhat.com> (raw)
In-Reply-To: <20250617050240.GA2178@lst.de>

On Tue, 2025-06-17 at 07:02 +0200, Christoph Hellwig wrote:
> Please try this proper fix instead:
> 
> diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
> index e021f1106bea..09f5fb5b2fb1 100644
> --- a/drivers/scsi/hosts.c
> +++ b/drivers/scsi/hosts.c
> @@ -473,7 +473,9 @@ struct Scsi_Host *scsi_host_alloc(const struct
> scsi_host_template *sht, int priv
>         else
>                 shost->max_sectors = SCSI_DEFAULT_MAX_SECTORS;
>  
> -       if (sht->max_segment_size)
> +       if (sht->virt_boundary_mask)
> +               shost->virt_boundary_mask = sht->virt_boundary_mask;
> +       else if (sht->max_segment_size)
>                 shost->max_segment_size = sht->max_segment_size;
>         else
>                 shost->max_segment_size = BLK_MAX_SEGMENT_SIZE;
> @@ -492,9 +494,6 @@ struct Scsi_Host *scsi_host_alloc(const struct
> scsi_host_template *sht, int priv
>         else
>                 shost->dma_boundary = 0xffffffff;
>  
> -       if (sht->virt_boundary_mask)
> -               shost->virt_boundary_mask = sht->virt_boundary_mask;
> -
>         device_initialize(&shost->shost_gendev);
>         dev_set_name(&shost->shost_gendev, "host%d", shost->host_no);
>         shost->shost_gendev.bus = &scsi_bus_type;
> 

Hello

Not sure what you folks will decide as the final fix but Christoph's
patch prevents the REDO corruption as well.
Ran it long enough to know its clean from corruption with this patch
above

Tested-by: Laurence Oberman <loberman@redhat.com>

Thanks vey mauch as always folks

Regards
Laurence





  parent reply	other threads:[~2025-06-21  0:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2025-06-17 13:58 ` Laurence Oberman
2025-06-18  5:48 ` Christoph Hellwig

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=d122346c3aea794087da7d9f166a412349517503.camel@redhat.com \
    --to=loberman@redhat.com \
    --cc=emilne@redhat.com \
    --cc=haiyangz@microsoft.com \
    --cc=hch@lst.de \
    --cc=kys@microsoft.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=ming.lei@redhat.com \
    --cc=wei.liu@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox