Re: [PATCH] scsi_lib: Align max_sectors to kb

Martin Wilck
2024-04-18T16:46:09Z

On Thu, 2024-04-18 at 16:51 +0200, Christoph Hellwig wrote:
>
> > > Note that we really should not stack max_sectors anyway, as it's
> > > only
> > > used for splitting in the lower device to start with.
> >
> > If that's the case, why don't we inhibit the modification for
> > max_sectors
> > on the lower devices?
>
> Why would we?  It makes absolutly no sense to inherit these limits,
> the lower device will split anyway which is very much the point of
> the immutable bio_vec work.
>

Sorry, I don't follow. With (request-based) dm-multipath on top of
SCSI, we hit the "over max size limit" condition in
blk_insert_cloned_request() [1], which will cause IO to fail at the dm
level. So at least in this configuration, it's crucial that the upper
device inherit the lower device's limits.

Regards,
Martin

[1] https://elixir.bootlin.com/linux/latest/source/block/blk-mq.c#L3048