Skip to contentSkip to conversation

master - cleanup: reorder condition

PATCH Zdenek Kabelac 1 participant 1 message Apr 20, 2018

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=27a1a0e5c04806e217dbd9c197dc95c05341ed54
Commit:        27a1a0e5c04806e217dbd9c197dc95c05341ed54
Parent:        1287edf6264b910a1f0d6dfbd809c2b51fe3ff2a
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Thu Mar 29 22:53:13 2018 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Fri Apr 20 12:17:01 2018 +0200

cleanup: reorder condition

There is no point to wait for sync for non-locally active LV.

---
 lib/metadata/lv_manip.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
lib/metadata/lv_manip.c +6 -6
index e377cf8..97a4e39 100644
@@ -7149,6 +7149,12 @@ int wipe_lv(struct logical_volume *lv, struct wipe_params wp)
 		/* nothing to do */
 		return 1;
 
+	if (!lv_is_active_locally(lv)) {
+		log_error("Volume \"%s/%s\" is not active locally (volume_list activation filter?).",
+			  lv->vg->name, lv->name);
+		return 0;
+	}
+
 	/* Wait until devices are available */
 	if (!sync_local_dev_names(lv->vg->cmd)) {
 		log_error("Failed to sync local devices before wiping LV %s.",
@@ -7156,12 +7162,6 @@ int wipe_lv(struct logical_volume *lv, struct wipe_params wp)
 		return 0;
 	}
 
-	if (!lv_is_active_locally(lv)) {
-		log_error("Volume \"%s/%s\" is not active locally (volume_list activation filter?).",
-			  lv->vg->name, lv->name);
-		return 0;
-	}
-
 	/*
 	 * FIXME:
 	 * <clausen> also, more than 4k