All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: John Garry <john.g.garry@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Bart Van Assche <bvanassche@acm.org>,
	Ming Lei <ming.lei@redhat.com>,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>, "Ewan D. Milne" <emilne@redhat.com>,
	Laurence Oberman <loberman@redhat.com>,
	linux-rdma@vger.kernel.org, linux-scsi@vger.kernel.org,
	linux-block@vger.kernel.org
Subject: Re: [PATCH 2/2] scsi: enforce unlimited max_segment_size when virt_boundary_mask is set
Date: Mon, 23 Jun 2025 15:35:43 +0200	[thread overview]
Message-ID: <20250623133542.GA27271@lst.de> (raw)
In-Reply-To: <447ba437-9742-4686-b159-bc2086c9b814@oracle.com>

On Mon, Jun 23, 2025 at 09:37:10AM +0100, John Garry wrote:
>> -	else
>> -		shost->max_segment_size = BLK_MAX_SEGMENT_SIZE;
>> +	if (sht->virt_boundary_mask)
>> +		shost->virt_boundary_mask = sht->virt_boundary_mask;
>
> nit: you could just always set shost->virt_boundary_mask = 
> sht->virt_boundary_mask

I could, but it would change behavior and break drivers.  The SCSI
midlayer allows overriding the template provided values in the host
itself after allocating and before adding it.  For the
virt_boundary_mask that features is used by iser and srp.

>> +	if (shost->virt_boundary_mask) {
>
> Or combine into a single if-else statement.
>
>> +		WARN_ON_ONCE(sht->max_segment_size &&
>> +			     sht->max_segment_size != UINT_MAX);
>> +		shost->max_segment_size = UINT_MAX;
>> +	} else {
>
> else if might be nicer, by maybe not as (I think) {} should be used and 
> that is not pretty for single line statements.

I also really want to keep the virt boundary vs non virt boundary cases
visually separe as that's the main branch.


  reply	other threads:[~2025-06-23 13:35 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-23  8:02 fix virt_boundary_mask handling in SCSI Christoph Hellwig
2025-06-23  8:02 ` [PATCH 1/2] RDMA/srp: don't set a max_segment_size when virt_boundary_mask is set Christoph Hellwig
2025-06-23 15:31   ` Bart Van Assche
2025-06-24  5:57   ` Hannes Reinecke
2025-06-23  8:02 ` [PATCH 2/2] scsi: enforce unlimited " Christoph Hellwig
2025-06-23  8:37   ` John Garry
2025-06-23 13:35     ` Christoph Hellwig [this message]
2025-06-23 14:03       ` John Garry
2025-06-23 14:05         ` Christoph Hellwig
2025-06-23  9:50   ` Ming Lei
2025-06-24  5:57   ` Hannes Reinecke
2025-06-24 14:21 ` fix virt_boundary_mask handling in SCSI Laurence Oberman
2025-06-24 16:11   ` Laurence Oberman
2025-06-24 16:13     ` Laurence Oberman
  -- strict thread matches above, loose matches on Subject: below --
2025-06-24 12:52 fix virt_boundary_mask handling in SCSI v2 Christoph Hellwig
2025-06-24 12:52 ` [PATCH 2/2] scsi: enforce unlimited max_segment_size when virt_boundary_mask is set Christoph Hellwig
2025-06-24 15:56   ` Bart Van Assche

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=20250623133542.GA27271@lst.de \
    --to=hch@lst.de \
    --cc=bvanassche@acm.org \
    --cc=emilne@redhat.com \
    --cc=haiyangz@microsoft.com \
    --cc=john.g.garry@oracle.com \
    --cc=kys@microsoft.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=loberman@redhat.com \
    --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 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.