]> sourceware.org Git - lvm2.git/commitdiff
Don't attempt to restart pvmoves when deactivating LVs in vgchange.
authorAlasdair Kergon <agk@redhat.com>
Tue, 29 Sep 2009 20:22:35 +0000 (20:22 +0000)
committerAlasdair Kergon <agk@redhat.com>
Tue, 29 Sep 2009 20:22:35 +0000 (20:22 +0000)
Restart lvconverts in vgchange by sharing lv_spawn_background_polling.

WHATS_NEW
tools/lvchange.c
tools/toollib.c
tools/toollib.h
tools/vgchange.c

index 10c899b05a3d9bbc669045339f3ba2e0b3acf735..2be4abb70956afddfc4bfa67c4d964d43c1002be 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,7 @@
 Version 2.02.54 -
 =====================================
+  Don't attempt to restart pvmoves when deactivating LVs in vgchange.
+  Restart lvconverts in vgchange by sharing lv_spawn_background_polling.
   Generalise polldaemon code by changing mirror-specific variable names.
   Don't attempt to deactivate an LV if any of its snapshots are in use.
   Return fail if lv_deactivate fails to remove device from kernel.
index b9be0c2a17d9786c6e15fb0186b6e38df3fed4ea..db22cadce5a0f2926122d5a9bd3d1cecaee57438 100644 (file)
@@ -105,7 +105,6 @@ static int lvchange_availability(struct cmd_context *cmd,
                                 struct logical_volume *lv)
 {
        int activate;
-       const char *pvname;
 
        activate = arg_uint_value(cmd, available_ARG, 0);
 
@@ -136,18 +135,7 @@ static int lvchange_availability(struct cmd_context *cmd,
                                return_0;
                }
 
-               if ((lv->status & LOCKED) &&
-                   (pvname = get_pvmove_pvname_from_lv(lv))) {
-                       log_verbose("Spawning background pvmove process for %s",
-                                   pvname);
-                       pvmove_poll(cmd, pvname, 1);
-               }
-
-               if (lv->status & CONVERTING) {
-                       log_verbose("Spawning background lvconvert process for %s",
-                                   lv->name);
-                       lvconvert_poll(cmd, lv, 1);
-               }
+               lv_spawn_background_polling(cmd, lv);
        }
 
        return 1;
index afecaea80986d35594b33b300b5b93d7939b3faa..ed38e188ef22e4029859e7aa0d666d8b84dd67e8 100644 (file)
@@ -1247,3 +1247,22 @@ int vg_refresh_visible(struct cmd_context *cmd, struct volume_group *vg)
        
        return r;
 }
+
+void lv_spawn_background_polling(struct cmd_context *cmd,
+                                struct logical_volume *lv)
+{
+       const char *pvname;
+
+       if ((lv->status & LOCKED) &&
+           (pvname = get_pvmove_pvname_from_lv(lv))) {
+               log_verbose("Spawning background pvmove process for %s",
+                           pvname);
+               pvmove_poll(cmd, pvname, 1);
+       }
+
+       if (lv->status & CONVERTING) {
+               log_verbose("Spawning background lvconvert process for %s",
+                       lv->name);
+               lvconvert_poll(cmd, lv, 1);
+       }
+}
index 273cb65fbdb20aad6bfe1597708f6e4f3a1e4bd1..59cbeb6cc239e762e352e3aafa5dc1ba75d4d68c 100644 (file)
@@ -105,4 +105,7 @@ int fill_vg_create_params(struct cmd_context *cmd,
 
 int lv_refresh(struct cmd_context *cmd, struct logical_volume *lv);
 int vg_refresh_visible(struct cmd_context *cmd, struct volume_group *vg);
+void lv_spawn_background_polling(struct cmd_context *cmd,
+                                struct logical_volume *lv);
+
 #endif
index 95b0b48cae57c46ed34a5a88ffe1365a2dd9e541..cef19c06ed21b407dd181e958a58b89dad68ac30 100644 (file)
@@ -91,13 +91,9 @@ static int _activate_lvs_in_vg(struct cmd_context *cmd,
                } else if (!activate_lv(cmd, lv))
                        continue;
 
-               if ((lv->status & PVMOVE) &&
-                   (pvname = get_pvmove_pvname_from_lv_mirr(lv))) {
-                       log_verbose("Spawning background process for %s %s",
-                                   lv->name, pvname);
-                       pvmove_poll(cmd, pvname, 1);
-                       continue;
-               }
+               if (activate != CHANGE_AN && activate != CHANGE_ALN &&
+                   (lv->status & (PVMOVE|CONVERTING)))
+                       lv_spawn_background_polling(cmd, lv);
 
                count++;
        }
This page took 0.050673 seconds and 5 git commands to generate.