On Fri, Mar 27, 2026 at 03:41:50PM -0400, Benjamin Marzinski wrote:
> > @@ -4047,9 +4047,15 @@ static void dm_integrity_io_hints(struct dm_target 
> > *ti, struct queue_limits *lim
> >     struct dm_integrity_c *ic = ti->private;
> >  
> >     if (ic->sectors_per_block > 1) {
> > -           limits->logical_block_size = ic->sectors_per_block << 
> > SECTOR_SHIFT;
> > -           limits->physical_block_size = ic->sectors_per_block << 
> > SECTOR_SHIFT;
> > -           limits->io_min = ic->sectors_per_block << SECTOR_SHIFT;
> > +           limits->logical_block_size =
> > +                           max(limits->logical_block_size,
> > +                               ic->sectors_per_block << SECTOR_SHIFT);
> > +           limits->physical_block_size =
> > +                           max(limits->physical_block_size,
> > +                               ic->sectors_per_block << SECTOR_SHIFT);
> > +           limits->io_min =
> > +                           max(limits->io_min,
> > +                               ic->sectors_per_block << SECTOR_SHIFT);
> >             limits->dma_alignment = limits->logical_block_size - 1;
> >             limits->discard_granularity = ic->sectors_per_block << 
> > SECTOR_SHIFT;
> 
> Shouldn't this also respect the underlying device's discard_granularity?

It doesn't appear to. I left it unchanged as I'm not very familiar with
this device mapper, so that seemed safer. But I thought it was fine as
is: this dm doesn't appear to forward discards, so the underlying
device's constraints aren't brought into the operation. It looks like it
just sets a "DISCARD_FILLER" pattern into metadata.

Reply via email to