diff --git a/device_mapper/libdm-deptree.c b/device_mapper/libdm-deptree.c index 2200e7255..77e2b4d50 100644 --- a/device_mapper/libdm-deptree.c +++ b/device_mapper/libdm-deptree.c @@ -1752,7 +1752,12 @@ static int _dm_tree_deactivate_children(struct dm_tree_node *dnode, if (info.open_count) { /* Skip internal non-toplevel opened nodes */ - if (level) + /* On some old udev systems without corrrect udev rules + * this hack avoids 'leaking' active _mimageX legs after + * deactivation of mirror LV. Other suffixes are not added + * since it's expected newer systems with wider range of + * supported targets also use better udev */ + if (level && !strstr(name, "_mimage")) continue; /* When retry is not allowed, error */