All of lore.kernel.org
 help / color / mirror / Atom feed
From: mbroz@sourceware.org <mbroz@sourceware.org>
To: lvm-devel@redhat.com
Subject: LVM2 ./WHATS_NEW lib/metadata/lv_manip.c tools ...
Date: 20 May 2009 09:55:35 -0000	[thread overview]
Message-ID: <20090520095535.13608.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz at sourceware.org	2009-05-20 09:55:34

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 
	tools          : lvchange.c 

Log message:
	Use lock query instead of activate_lv_excl
	
	- switch lvremove to not force activate volume when removing
	- ditto for force resync
	
	- fix some wrong return codes in lvchange_resync()

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1117&r2=1.1118
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.172&r2=1.173
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvchange.c.diff?cvsroot=lvm2&r1=1.100&r2=1.101

--- LVM2/WHATS_NEW	2009/05/20 09:52:37	1.1117
+++ LVM2/WHATS_NEW	2009/05/20 09:55:33	1.1118
@@ -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.
--- LVM2/lib/metadata/lv_manip.c	2009/05/13 21:29:10	1.172
+++ LVM2/lib/metadata/lv_manip.c	2009/05/20 09:55:34	1.173
@@ -2036,28 +2036,13 @@
 			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;
 		}
 	}
 
--- LVM2/tools/lvchange.c	2009/05/13 21:27:44	1.100
+++ LVM2/tools/lvchange.c	2009/05/20 09:55:34	1.101
@@ -201,7 +201,7 @@
 		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 @@
 					  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 @@
 	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;



             reply	other threads:[~2009-05-20  9:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-20  9:55 mbroz [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-05-27 18:19 LVM2 ./WHATS_NEW lib/metadata/lv_manip.c tools agk
2011-10-06 15:32 jbrassow
2012-01-20 22:03 snitzer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090520095535.13608.qmail@sourceware.org \
    --to=mbroz@sourceware.org \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.