Skip to contentSkip to conversation

master - lvremove: few more validation before archive

PATCH Zdenek Kabelac 1 participant 1 message Nov 10, 2014

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=979d12eb4a69ad328a8583eaafc4d3d30e4d1771
Commit:        979d12eb4a69ad328a8583eaafc4d3d30e4d1771
Parent:        e2c4a3ef67261d4a8d32b62906b05e4292b47f90
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Sat Nov 8 23:15:15 2014 +0100
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Mon Nov 10 22:05:48 2014 +0100

lvremove: few more validation before archive

Before we finally call archive, we still can do a few more validation without modifying VG. So delay archive() call few lines.

---
 lib/metadata/lv_manip.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
lib/metadata/lv_manip.c +3 -3
index b029395..1943c07 100644
@@ -5404,9 +5404,6 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv,
 		return 0;
 	}
 
-	if (!archive(vg))
-		return 0;
-
 	if (lv_is_cache(lv)) {
 		if (!lv_remove_single(cmd, first_seg(lv)->pool_lv, force,
 				      suppress_remove_message)) {
@@ -5420,6 +5417,9 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv,
 		}
 	}
 
+	if (!archive(vg))
+		return 0;
+
 	if (lv_is_cow(lv)) {
 		/* Old format1 code */
 		if (!(lv->vg->fid->fmt->features & FMT_MDAS))