Re: [PATCH 2/2] scsi: enforce unlimited max_segment_size when virt_boundary_mask is set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.





[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux