Skip to contentSkip to conversation

master - pvmove.c: relocate id components extraction

PATCH okozina 1 participant 1 message May 15, 2015

lore
Share & tools
lore

okozina

author
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=04c77bd8863b071b9e376c76708af6cede596a45
Commit:        04c77bd8863b071b9e376c76708af6cede596a45
Parent:        67657f1ff938b2afd17ab0ce6476a561725a6781
Author:        Ondrej Kozina <[email protected]>
AuthorDate:    Fri May 15 17:06:14 2015 +0200
Committer:     Ondrej Kozina <[email protected]>
CommitterDate: Fri May 15 20:33:21 2015 +0200

pvmove.c: relocate id components extraction

we don't want to fail properly set pvmove after metadata update. failure to copy id components could end with dangling mirror moving PV segments but no monitoring from lvmpolld or classical polldaemon.

---
 tools/pvmove.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
tools/pvmove.c +3 -3
index 202c87c..94a5ffc 100644
@@ -686,13 +686,13 @@ static int _set_up_pvmove(struct cmd_context *cmd, const char *pv_name,
 	/* init_pvmove(1); */
 	/* vg->status |= PVMOVE; */
 
+	if (!_copy_id_components(cmd, lv_mirr, vg_name, lv_mirr_name, lvid))
+		goto out;
+
 	if (flags & PVMOVE_FIRST_TIME)
 		if (!_update_metadata(cmd, vg, lv_mirr, lvs_changed, exclusive))
 			goto_out;
 
-	if (!_copy_id_components(cmd, lv_mirr, vg_name, lv_mirr_name, lvid))
-		goto out;
-
 	/* LVs are all in status LOCKED */
 	r = ECMD_PROCESSED;
 out: