]> sourceware.org Git - lvm2.git/commitdiff
Use lock query instead of activate_lv_excl
authorMilan Broz <mbroz@redhat.com>
Wed, 20 May 2009 09:55:33 +0000 (09:55 +0000)
committerMilan Broz <mbroz@redhat.com>
Wed, 20 May 2009 09:55:33 +0000 (09:55 +0000)
 - switch lvremove to not force activate volume when removing
 - ditto for force resync

 - fix some wrong return codes in lvchange_resync()

WHATS_NEW
lib/metadata/lv_manip.c
tools/lvchange.c

index 24011a89e4efbff4181c2030c9941393ec6c2281..0f1f6eb239e0ba7aab032515cc4bb3dfaac65aff 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.46 - 
 ================================
+  Use lock query instead of activate_lv_excl.
   Enable online resizing of mirrors.
   Use suspend with flush when device size was changed during table preload.
   Introduce CLVMD_CMD_LOCK_QUERY command for clvmd.
index 761cd9ee736a562bdd3b158c4e47a237e0305fa5..9a8045a598268cb9db15d821a68dde01dce1214e 100644 (file)
@@ -2036,28 +2036,13 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv,
                        return 0;
                }
 
-               /*
-                * Check for confirmation prompts in the following cases:
-                * 1) Clustered VG, and some remote nodes have the LV active
-                * 2) Non-clustered VG, but LV active locally
-                */
-               if (vg_is_clustered(vg) && !activate_lv_excl(cmd, lv) &&
-                   (force == PROMPT)) {
-                       if (yes_no_prompt("Logical volume \"%s\" is active on other "
-                                         "cluster nodes.  Really remove? [y/n]: ",
-                                         lv->name) == 'n') {
-                               log_print("Logical volume \"%s\" not removed",
-                                         lv->name);
-                               return 0;
-                       }
-               } else if (info.exists && (force == PROMPT)) {
-                        if (yes_no_prompt("Do you really want to remove active "
-                                          "logical volume \"%s\"? [y/n]: ",
-                                          lv->name) == 'n') {
-                               log_print("Logical volume \"%s\" not removed",
-                                         lv->name);
-                               return 0;
-                        }
+               if (lv_is_active(lv) && (force == PROMPT) &&
+                   yes_no_prompt("Do you really want to remove active "
+                                 "%slogical volume %s? [y/n]: ",
+                                 vg_is_clustered(vg) ? "clustered " : "",
+                                 lv->name) == 'n') {
+                       log_print("Logical volume %s not removed", lv->name);
+                       return 0;
                }
        }
 
index 466fe29a2ca0b42f3c37e57954df02f83cb4276b..4a314a3b1073fd96fe0a804436c39fabaa2b07f3 100644 (file)
@@ -201,7 +201,7 @@ static int lvchange_resync(struct cmd_context *cmd,
                if (info.open_count) {
                        log_error("Can't resync open logical volume \"%s\"",
                                  lv->name);
-                       return ECMD_FAILED;
+                       return 0;
                }
 
                if (info.exists) {
@@ -211,11 +211,11 @@ static int lvchange_resync(struct cmd_context *cmd,
                                          lv->name) == 'n') {
                                log_print("Logical volume \"%s\" not resynced",
                                          lv->name);
-                               return ECMD_FAILED;
+                               return 0;
                        }
 
                        if (sigint_caught())
-                               return ECMD_FAILED;
+                               return 0;
 
                        active = 1;
                }
@@ -225,17 +225,17 @@ static int lvchange_resync(struct cmd_context *cmd,
        monitored = dmeventd_monitor_mode();
        init_dmeventd_monitor(0);
 
-       if (vg_is_clustered(lv->vg) && !activate_lv_excl(cmd, lv)) {
-               log_error("Can't get exclusive access to clustered volume %s",
-                         lv->name);
-               return ECMD_FAILED;
-       }
-
        if (!deactivate_lv(cmd, lv)) {
                log_error("Unable to deactivate %s for resync", lv->name);
                return 0;
        }
 
+       if (vg_is_clustered(lv->vg) && lv_is_active(lv)) {
+               log_error("Can't get exclusive access to clustered volume %s",
+                         lv->name);
+               return 0;
+       }
+
        init_dmeventd_monitor(monitored);
 
        log_lv = first_seg(lv)->log_lv;
This page took 0.04529 seconds and 5 git commands to generate.