]> sourceware.org Git - lvm2.git/commitdiff
snapshot: add synchronization point
authorZdenek Kabelac <zkabelac@redhat.com>
Wed, 24 Jun 2015 13:12:43 +0000 (15:12 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Wed, 24 Jun 2015 13:18:49 +0000 (15:18 +0200)
Synchronize with udev logic before reusing device as snapshot.

This patch tries to fix the problem with udev, where we manage
to 'active' LV for clearing, then we deactivate such device and
active again as member of 'origin&snapshot' tree all in 1 step.

There needs to be a sync point where udev has time to remove all links,
otherwise we race with scans and we may end-up with mysterious 'free'
links in the system pointing to wrong dm names.

This patch tries to fix failing topology cluster tests..

WHATS_NEW
lib/metadata/lv_manip.c

index 94766af537c6715a19800cf39c60c2d9c395f399..34f4cf0c755c16d1a8eaae1a87a7df4da78ca18b 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.123 - 
 =================================
+  Add device synchronization point before activating a new snapshot.
   Add --withspaces to lvmconfig to add spaces in output for better readability.
 
 Version 2.02.122 - 20th June 2015
index 07f119a44e8ea457e0ff46c98bb0811fa48b9d8d..de967433974a3487d31ca46bcdd8198f91babf7f 100644 (file)
@@ -7446,6 +7446,9 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
                        goto deactivate_and_revert_new_lv; /* Let's retry on error path */
                }
 
+               /* Get in sync with deactivation, before reusing LV as snapshot */
+               sync_local_dev_names(lv->vg->cmd);
+
                /* Create zero origin volume for spare snapshot */
                if (lp->virtual_extents &&
                    !(origin_lv = _create_virtual_origin(cmd, vg, lv->name,
This page took 0.059421 seconds and 5 git commands to generate.