diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2016-12-11 14:26:17 +0100 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2016-12-11 23:22:36 +0100 |
commit | 3903f915f83634f91946550fda85d60b72ce3a88 (patch) | |
tree | 04c53ffe8e6d213724e3be274788a3399c8f96ed | |
parent | 67f9e6b175815d7a91a10ecc3d5098d30dbfed91 (diff) | |
download | lvm2-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_NEW | 1 | ||||
-rw-r--r-- | tools/pvmove_poll.c | 10 |
2 files changed, 6 insertions, 5 deletions
@@ -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 " |