Re: [PATCH 1/7] dm: don't change md if dm_table_set_restrictions() fails

Benjamin Marzinski
2025-03-10T16:39:24Z

On Mon, Mar 10, 2025 at 08:18:31AM +0900, Damien Le Moal wrote:
> On 3/10/25 07:28, Benjamin Marzinski wrote:
> > __bind was changing the disk capacity, geometry and mempools of the
> > mapped device before calling dm_table_set_restrictions() which could
> > fail, forcing dm to drop the new table. Failing here would leave the
> > device using the old table but with the wrong capacity and mempools.
> >
> > Move dm_table_set_restrictions() earlier in __bind(). Since it needs the
> > capacity to be set, save the old version and restore it on failure.
> >
> > Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
>
> Does this need a "Fixes" tag maybe ?

Yeah. I can go through and add the appropriate Fixes tags.

-Ben

>
> Otherwise looks good to me.
>
> Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
>
> --
> Damien Le Moal
> Western Digital Research