]> sourceware.org Git - lvm2.git/commitdiff
Return immediately dm_lib_exit() if called more than once.
authorAlasdair Kergon <agk@redhat.com>
Fri, 24 Jun 2011 19:33:41 +0000 (19:33 +0000)
committerAlasdair Kergon <agk@redhat.com>
Fri, 24 Jun 2011 19:33:41 +0000 (19:33 +0000)
(Avoiding calling it twice would involve some untangling.)
Decrement the new suspended_counter if removing a suspended device.

WHATS_NEW_DM
libdm/ioctl/libdm-iface.c
libdm/libdm-deptree.c

index c17475f176c9329ec43c58ae05a676f72c7182bd..9654aef56f39a72732d71422bb65c4a3a167f3a5 100644 (file)
@@ -1,5 +1,6 @@
 Version 1.02.65 - 
 ==================================
+  Return immediately dm_lib_exit() if called more than once.
   Disable udev fallback by default and add --udevfallback option to dmsetup.
   Warn if a table is loaded while a device is known to be in suspended state.
   Add dm_get_suspended_counter() for number of devs in suspended state by lib.
index 3028fd850cfb64bfee6d60b509c02ea9ace543a0..1157f25dfc2f55f267bb338341c4b958181fba5a 100644 (file)
@@ -2173,6 +2173,15 @@ void dm_pools_check_leaks(void);
 
 void dm_lib_exit(void)
 {
+       int suspended_counter;
+       static unsigned _exited = 0;
+
+       if (_exited++)
+               return;
+
+       if ((suspended_counter = dm_get_suspended_counter()))
+               log_error("libdevmapper exiting with %d device(s) still suspended.", suspended_counter);
+
        dm_lib_release();
        selinux_release();
        if (_dm_bitset)
index e316a42616990839c5c2c765ea4bcc05cd264af6..ff1f0dded21f3d75a279dd80898d464b7756ab14 100644 (file)
@@ -1188,7 +1188,8 @@ static int _dm_tree_deactivate_children(struct dm_tree_node *dnode,
                                  info.minor);
                        r = 0;
                        continue;
-               }
+               } else if (info.suspended)
+                       dec_suspended();
 
                if (dm_tree_node_num_children(child, 0)) {
                        if (!_dm_tree_deactivate_children(child, uuid_prefix, uuid_prefix_len, level + 1))
This page took 0.04083 seconds and 5 git commands to generate.