summaryrefslogtreecommitdiff
path: root/tools/pvmove_poll.c
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 /tools/pvmove_poll.c
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.
Diffstat (limited to 'tools/pvmove_poll.c')
-rw-r--r--tools/pvmove_poll.c10
1 files changed, 5 insertions, 5 deletions
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 "