]> sourceware.org Git - lvm2.git/commitdiff
lvmetad: Flush a VG if it goes completely missing due to pv_found.
authorPetr Rockai <prockai@redhat.com>
Tue, 7 Jan 2014 02:28:20 +0000 (03:28 +0100)
committerPetr Rockai <prockai@redhat.com>
Tue, 7 Jan 2014 02:28:20 +0000 (03:28 +0100)
daemons/lvmetad/lvmetad-core.c

index 7409839f29aeee1899e66da319caa8fad6649fcf..19e0b6b8c4865daed55ee7a22bfaf5c322a28967 100644 (file)
@@ -859,6 +859,7 @@ static response pv_found(lvmetad_state *s, request r)
        const char *pvid = daemon_request_str(r, "pvmeta/id", NULL);
        const char *vgname = daemon_request_str(r, "vgname", NULL);
        const char *vgid = daemon_request_str(r, "metadata/id", NULL);
+       const char *vgid_old;
        struct dm_config_node *pvmeta = dm_config_find_node(r.cft->root, "pvmeta");
        uint64_t device;
        struct dm_config_tree *cft, *pvmeta_old_dev = NULL, *pvmeta_old_pvid = NULL;
@@ -880,6 +881,12 @@ static response pv_found(lvmetad_state *s, request r)
        if ((old = dm_hash_lookup_binary(s->device_to_pvid, &device, sizeof(device)))) {
                pvmeta_old_dev = dm_hash_lookup(s->pvid_to_pvmeta, old);
                dm_hash_remove(s->pvid_to_pvmeta, old);
+
+               if (vgid_old = dm_hash_lookup(s->pvid_to_vgid, pvid)) {
+                       lock_vg(s, vgid_old);
+                       vg_remove_if_missing(s, vgid_old, 1);
+                       unlock_vg(s, vgid_old);
+               }
        }
        pvmeta_old_pvid = dm_hash_lookup(s->pvid_to_pvmeta, pvid);
 
This page took 0.036703 seconds and 5 git commands to generate.