1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00

devicemapper: retry mirror leg deactivation

This could be seen as continuation of
6cee8f1b06.
Some test maching with old udev system shows problem,
where udev 'jumps on' leg device after mirror target
releases its legs -  since udev does not (in this old case) skips
such device from scanning - it opens device - and this prevent
leg device to be deactivated - effectively such device stays
'leaked' in DM table invisibly to lvm2 command.

So to 'combat' this issue - if the device has '_mimage' in its name,
the retry of deactivation is automatically assumed.

NOTE: wider impact is unexpected - as it's touching only old mirror
target which is nowadays replaced with 'raid'.

In case there will be some problem identified - probably both patches
should be reverted.
This commit is contained in:
Zdenek Kabelac 2018-11-12 15:22:44 +01:00 committed by David Teigland
parent 0eafb76772
commit bac5d782ca

View File

@ -1752,7 +1752,12 @@ static int _dm_tree_deactivate_children(struct dm_tree_node *dnode,
if (info.open_count) { if (info.open_count) {
/* Skip internal non-toplevel opened nodes */ /* 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; continue;
/* When retry is not allowed, error */ /* When retry is not allowed, error */