Thread (14 messages) 14 messages, 6 authors, 2025-06-24

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 13:35:47
Also in: linux-rdma, linux-scsi

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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help