summaryrefslogtreecommitdiff
path: root/tools/pvmove.c
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2018-03-27 21:08:40 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2018-04-20 12:03:16 +0200
commitace97c9f9cdc6f0bfd33ae465404169a33953c1e (patch)
treeae989e386244f8cb2c220283d93fb5f28bea8a78 /tools/pvmove.c
parent7a7b8a7778aace88c967ee8285485c494ce1f3f8 (diff)
downloadlvm2-ace97c9f9cdc6f0bfd33ae465404169a33953c1e.tar.gz
pvmove: support properly subLV locking
Since we support snapshot of mirrors, we do need to properly check for stacked lock holder - fixes problem of pvmove in cluster with mirrors under snapshot. WHATS_NEW for this patch goes with 'Restore pvmove support...'
Diffstat (limited to 'tools/pvmove.c')
-rw-r--r--tools/pvmove.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/tools/pvmove.c b/tools/pvmove.c
index 2a26a1036..84efdf4e7 100644
--- a/tools/pvmove.c
+++ b/tools/pvmove.c
@@ -393,10 +393,15 @@ static struct logical_volume *_set_up_pvmove_lv(struct cmd_context *cmd,
}
seg = first_seg(lv);
-
- /* Presence of exclusive LV decides whether pvmove must be also exclusive */
- if ((seg_only_exclusive(seg) || lv_is_origin(lv) || lv_is_cow(lv)))
- needs_exclusive = 1;
+ if (!needs_exclusive) {
+ /* Presence of exclusive LV decides whether pvmove must be also exclusive */
+ if (!seg_only_exclusive(seg)) {
+ holder = lv_lock_holder(lv);
+ if (seg_only_exclusive(first_seg(holder)) || lv_is_origin(holder) || lv_is_cow(holder))
+ needs_exclusive = 1;
+ } else
+ needs_exclusive = 1;
+ }
if (seg_is_raid(seg) || seg_is_mirrored(seg)) {
dm_list_init(&trim_list);