On Thu, Nov 21, 2024 at 09:57:28AM +0100, Martin Wilck wrote: > On Wed, 2024-11-20 at 16:59 -0500, Benjamin Marzinski wrote: > > > > How would you feel about adding a parameter to do_foreach_partmaps() > > to > > say whether or not it should remove empty partmaps (or possibly just > > checking if the partmap_func is remove_partmaps). Your argument > > makes > > sense when you are removing a device. But what about functions like > > dm_cancel_remove_partmaps() and dm_rename_partmaps()? I'm not sure > > that > > these should automatically empty (a possibly being created) partition > > devices. > > We're moving far into corner case land here :-) > > I think we should keep it as simple as possible. For me, that means > that an empty partition map (with UUID matching the current mpath map) > should be treated like any other partition map with matching UUID, no > matter what the current operation is. > > There will be some situations where the outcome will be suboptimal. By > keeping it simple, we'll at least be able to understand the outcome. That's reasonable. I misunderstood your suggestion as asking to always remove empty partition devices in do_foreach_partmaps(). We'd need to make sure all the partmap_func()s work with empty devices. But that shouldn't be too bad. -Ben > Martin