public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
From: zkabelac@sourceware.org
To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org
Subject: LVM2 ./WHATS_NEW lib/metadata/lv_manip.c test/ ...
Date: Fri, 18 Nov 2011 19:25:00 -0000	[thread overview]
Message-ID: <20111118192521.17021.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-11-18 19:25:21

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 
	test           : t-lvcreate-usage.sh 

Log message:
	Query before removing inactive snapshots
	
	Removal of an inactive origin removes also all related snapshots.
	
	When we now support 'old' external snapshots with thin volumes,
	removal of pool will not only drop all thin volumes, but as
	a consequence also all snapshots - which might be seen a bit
	unexpected for the user - so add a query to confirm such action.
	
	lvremove -f will skip the prompt.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2188&r2=1.2189
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.337&r2=1.338
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-lvcreate-usage.sh.diff?cvsroot=lvm2&r1=1.20&r2=1.21

--- LVM2/WHATS_NEW	2011/11/18 19:22:49	1.2188
+++ LVM2/WHATS_NEW	2011/11/18 19:25:20	1.2189
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Add query before removing snapshots when inactive snapshot origin is removed.
   Allow changing availability state of snapshots.
   Skip non-virtual snapshots for availability change for lvchange with vg name.
   Adjusted mirror region size only for mirrors and raids.
--- LVM2/lib/metadata/lv_manip.c	2011/11/15 17:32:12	1.337
+++ LVM2/lib/metadata/lv_manip.c	2011/11/18 19:25:20	1.338
@@ -3248,7 +3248,17 @@
 	}
 
 	if (lv_is_origin(lv)) {
-		/* remove snapshot LVs first */
+		/* Remove snapshot LVs first */
+		if ((force == PROMPT) &&
+		    /* Active snapshot already needs to confirm each active LV */
+		    !lv_is_active(lv) &&
+		    yes_no_prompt("Removing origin %s will also remove %u "
+				  "snapshots(s). Proceed? [y/n]: ",
+				  lv->name, lv->origin_count) == 'n') {
+			log_error("Logical volume %s not removed.", lv->name);
+			return 0;
+		}
+
 		dm_list_iterate_safe(snh, snht, &lv->snapshot_segs)
 			if (!lv_remove_with_dependencies(cmd, dm_list_struct_base(snh, struct lv_segment,
 										  origin_list)->cow,
--- LVM2/test/t-lvcreate-usage.sh	2011/06/28 09:43:28	1.20
+++ LVM2/test/t-lvcreate-usage.sh	2011/11/18 19:25:21	1.21
@@ -122,7 +122,7 @@
 lvrename $vg/$lv1 $vg/$lv2
 lvcreate -s --virtualoriginsize 64m -L 32m -n $lv1 $vg
 lvchange -a n $vg/$lv1
-lvremove $vg/$lv1
+lvremove -ff $vg/$lv1
 lvremove -ff $vg
 
 # readahead default (auto), none, #, auto


             reply	other threads:[~2011-11-18 19:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-18 19:25 zkabelac [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-05-05  2:08 jbrassow
2012-05-01 19:21 jbrassow
2011-06-23 10:53 mbroz
2009-06-01 15:55 mbroz

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=20111118192521.17021.qmail@sourceware.org \
    --to=zkabelac@sourceware.org \
    --cc=lvm-devel@redhat.com \
    --cc=lvm2-cvs@sourceware.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).