]> sourceware.org Git - lvm2.git/commitdiff
pvmove: support properly subLV locking
authorZdenek Kabelac <zkabelac@redhat.com>
Tue, 27 Mar 2018 19:08:40 +0000 (21:08 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Fri, 20 Apr 2018 10:03:16 +0000 (12:03 +0200)
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...'

tools/pvmove.c

index 2a26a1036579f627ebd2bc0acaa8b4fe08957b9f..84efdf4e70feb6a7dc10606d534ea266c0eafece 100644 (file)
@@ -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);
This page took 0.041201 seconds and 5 git commands to generate.