On Mon, Jun 23, 2025 at 09:37:10AM +0100, John Garry wrote:
quoted
- 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.
quoted
+ if (shost->virt_boundary_mask) {
Or combine into a single if-else statement.
quoted
+ 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.