On 04/15/2016 05:41 AM, Bart Van Assche wrote:
> On 04/04/16 03:00, Hannes Reinecke wrote:
>> diff --git a/block/blk-settings.c b/block/blk-settings.c
>> index c7bb666..29fa900 100644
>> --- a/block/blk-settings.c
>> +++ b/block/blk-settings.c
>> @@ -630,6 +630,9 @@ int blk_stack_limits(struct queue_limits *t,
>> struct queue_limits *b,
>> t->discard_granularity;
>> }
>>
>> + if (b->chunk_sectors)
>> + t->chunk_sectors = max(t->chunk_sectors, b->chunk_sectors);
>> +
>> return ret;
>> }
>> EXPORT_SYMBOL(blk_stack_limits);
>
> Hello Hannes,
>
> My understanding is that a non-zero chunk_sectors value defines a
> maximum I/O size. Shouldn't max() be changed into min_not_zero()?
> From include/linux/blkdev.h:
>
> static inline unsigned int blk_max_size_offset(struct request_queue *q,
> sector_t offset)
> {
> if (!q->limits.chunk_sectors)
> return q->limits.max_sectors;
>
> return q->limits.chunk_sectors -
> (offset & (q->limits.chunk_sectors - 1));
> }
>
Hmm.
_Actually_ it should be the least common denominator, me thinks...
Have to think it through a bit more.
Cheers,
Hannes
--
Dr. Hannes Reinecke Teamlead Storage & Networking
[email protected] +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html