]> sourceware.org Git - lvm2.git/commitdiff
Replicator: activate checks for missing vgs
authorZdenek Kabelac <zkabelac@redhat.com>
Fri, 21 May 2010 14:34:01 +0000 (14:34 +0000)
committerZdenek Kabelac <zkabelac@redhat.com>
Fri, 21 May 2010 14:34:01 +0000 (14:34 +0000)
Activation needs to have all remote VGs locked to pass for replicator.
So if activated LV is replicator-dev LV - read all remote VGs.

WHATS_NEW
lib/activate/activate.c

index 787ac8821ef114eb8d9530850dd85f0cfe3e8451..8ad627aa6f1061ab58560c4740f7580795a7131b 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,6 +1,7 @@
 Version 2.02.67 -
 ===============================
-  Check for missing VGs before taking lock_lv_vol (for Replicator).
+  Activation code read and releases also remote VGs (Replicator).
+  Check for missing VGs before taking lock_vol (Replicator).
   Update process_each_lv_in_vg() to use cmd_vg structure.
   Update _process_one_vg() to work with cmd_vg structure.
   Add functions for read and release VGs list.
index 1844cea793a4f1705fb8cd917a4aa79114b35730..c6c6af7a834ba956947f4695b85fc772ca8abb23 100644 (file)
@@ -865,6 +865,9 @@ static int _lv_suspend(struct cmd_context *cmd, const char *lvid_s,
                goto out;
        }
 
+       if (!lv_read_replicator_vgs(lv))
+               goto_out;
+
        lv_calculate_readahead(lv, NULL);
 
        /* If VG was precommitted, preload devices for the LV */
@@ -894,8 +897,10 @@ static int _lv_suspend(struct cmd_context *cmd, const char *lvid_s,
 out:
        if (lv_pre)
                vg_release(lv_pre->vg);
-       if (lv)
+       if (lv) {
+               lv_release_replicator_vgs(lv);
                vg_release(lv->vg);
+       }
 
        return r;
 }
@@ -1025,6 +1030,9 @@ int lv_deactivate(struct cmd_context *cmd, const char *lvid_s)
                        goto_out;
        }
 
+       if (!lv_read_replicator_vgs(lv))
+               goto_out;
+
        lv_calculate_readahead(lv, NULL);
 
        if (!monitor_dev_for_events(cmd, lv, 0))
@@ -1038,8 +1046,10 @@ int lv_deactivate(struct cmd_context *cmd, const char *lvid_s)
        if (!lv_info(cmd, lv, &info, 1, 0) || info.exists)
                r = 0;
 out:
-       if (lv)
+       if (lv) {
+               lv_release_replicator_vgs(lv);
                vg_release(lv->vg);
+       }
 
        return r;
 }
@@ -1118,6 +1128,9 @@ static int _lv_activate(struct cmd_context *cmd, const char *lvid_s,
                goto out;
        }
 
+       if (!lv_read_replicator_vgs(lv))
+               goto_out;
+
        lv_calculate_readahead(lv, NULL);
 
        if (exclusive)
@@ -1133,8 +1146,10 @@ static int _lv_activate(struct cmd_context *cmd, const char *lvid_s,
                stack;
 
 out:
-       if (lv)
+       if (lv) {
+               lv_release_replicator_vgs(lv);
                vg_release(lv->vg);
+       }
 
        return r;
 }
This page took 0.703804 seconds and 5 git commands to generate.