summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2016-12-11 14:26:17 +0100
committerZdenek Kabelac <zkabelac@redhat.com>2016-12-11 23:22:36 +0100
commit3903f915f83634f91946550fda85d60b72ce3a88 (patch)
tree04c53ffe8e6d213724e3be274788a3399c8f96ed
parent67f9e6b175815d7a91a10ecc3d5098d30dbfed91 (diff)
downloadlvm2-3903f915f83634f91946550fda85d60b72ce3a88.tar.gz
pvmove: fix activation order
For proper locking we need to gain lock first for mirror which needs to be deactivated later to be working in cluster.
-rw-r--r--WHATS_NEW1
-rw-r--r--tools/pvmove_poll.c10
2 files changed, 6 insertions, 5 deletions
diff --git a/WHATS_NEW b/WHATS_NEW
index 63cdb8989..ea15903fe 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.169 -
=====================================
+ Fix pvmove leaving -pvmove0 error device in clustered VG.
Avoid adding extra '_' at end of raid extracted images or metadata.
Optimize another _rmeta clearing code.
Fix deactivation of raid orphan devices for clustered VG.
diff --git a/tools/pvmove_poll.c b/tools/pvmove_poll.c
index ea4be247d..2cd746b22 100644
--- a/tools/pvmove_poll.c
+++ b/tools/pvmove_poll.c
@@ -157,17 +157,17 @@ int pvmove_finish(struct cmd_context *cmd, struct volume_group *vg,
return 0;
}
+ /* Unsuspend LVs */
+ if (!resume_lvs(cmd, lvs_changed))
+ stack;
+
/* Release mirror LV. (No pending I/O because it's been suspended.) */
- if (!resume_lv(cmd, lv_mirr)) {
+ if (!activate_lv_excl_local(cmd, lv_mirr)) {
log_error("Unable to reactivate logical volume \"%s\"",
lv_mirr->name);
r = 0;
}
- /* Unsuspend LVs */
- if (!resume_lvs(cmd, lvs_changed))
- stack;
-
/* Deactivate mirror LV */
if (!deactivate_lv(cmd, lv_mirr)) {
log_error("ABORTING: Unable to deactivate temporary logical "