Re: [PATCH 2/2] scsi: enforce unlimited max_segment_size when virt_boundary_mask is set
From: Christoph Hellwig <hch@lst.de>
Date: 2025-06-23 14:06:01
Also in:
linux-rdma, linux-scsi
From: Christoph Hellwig <hch@lst.de>
Date: 2025-06-23 14:06:01
Also in:
linux-rdma, linux-scsi
On Mon, Jun 23, 2025 at 03:03:27PM +0100, John Garry wrote:
On 23/06/2025 14:35, Christoph Hellwig wrote:quoted
On Mon, Jun 23, 2025 at 09:37:10AM +0100, John Garry wrote:quoted
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_maskI 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.Since shost is zero-init'ed, I did not think that my suggestion for this minor simplification in scsi_host_alloc() logically changes anything.
Oh, you're right - I thought we did the sht assignments in scsi_add_host. So the changes would be fine. But that also means we don't catch conflicts added by the direct shost manipulation.