summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Broz <mbroz@redhat.com>2012-03-26 20:33:40 +0000
committerMilan Broz <mbroz@redhat.com>2012-03-26 20:33:40 +0000
commitddb31b62e5cdecd5b44176a5def6d1f0408a9e00 (patch)
tree93dfea97541b068575656088215b2813b2e39c8a
parentdcd90bc501677849ee50b430ea956be7392dffae (diff)
downloadlvm2-ddb31b62e5cdecd5b44176a5def6d1f0408a9e00.tar.gz
lvm2-ddb31b62e5cdecd5b44176a5def6d1f0408a9e00.tar.xz
lvm2-ddb31b62e5cdecd5b44176a5def6d1f0408a9e00.zip
Keep exclusive activation in pvmove if LV is already active.
Pvmove should never try to downgrade exclusive lock for LVs. This allows pvmove to work again for exclusive activated LVs.
-rw-r--r--WHATS_NEW1
-rw-r--r--lib/locking/locking.c2
-rw-r--r--tools/pvmove.c2
3 files changed, 3 insertions, 2 deletions
diff --git a/WHATS_NEW b/WHATS_NEW
index 13cb12d7..eb5f53b0 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.96 -
================================
+ Keep exclusive activation in pvmove if LV is already active.
Disallow pvmove for exclusive LV if some affected LVs are not exclusively activated.
Remove unused and wrongly set cluster VG flag from clvmd lock query command.
Fix pvmove for exclusively activated LV pvmove in clustered VG. (2.02.86)
diff --git a/lib/locking/locking.c b/lib/locking/locking.c
index 1b4e0ac5..228078a2 100644
--- a/lib/locking/locking.c
+++ b/lib/locking/locking.c
@@ -574,7 +574,7 @@ int activate_lvs(struct cmd_context *cmd, struct dm_list *lvs, unsigned exclusiv
struct lv_list *lvl;
dm_list_iterate_items(lvl, lvs) {
- if (!exclusive) {
+ if (!exclusive && !lv_is_active_exclusive(lvl->lv)) {
if (!activate_lv(cmd, lvl->lv)) {
log_error("Failed to activate %s", lvl->lv->name);
return 0;
diff --git a/tools/pvmove.c b/tools/pvmove.c
index 9b9fe590..2d0e2d68 100644
--- a/tools/pvmove.c
+++ b/tools/pvmove.c
@@ -296,7 +296,7 @@ static int _activate_lv(struct cmd_context *cmd, struct logical_volume *lv_mirr,
{
int r = 0;
- if (exclusive)
+ if (exclusive || lv_is_active_exclusive(lv_mirr))
r = activate_lv_excl(cmd, lv_mirr);
else
r = activate_lv(cmd, lv_mirr);