]> sourceware.org Git - lvm2.git/commitdiff
lvmetad: Robustify update_pv_status and remove an useless lookup.
authorPetr Rockai <prockai@redhat.com>
Wed, 20 Jul 2011 21:26:18 +0000 (21:26 +0000)
committerPetr Rockai <prockai@redhat.com>
Wed, 20 Jul 2011 21:26:18 +0000 (21:26 +0000)
daemons/lvmetad/lvmetad-core.c

index 56f9a7fcca385ca4f86ffe0b1f33f257b3b4177d..a30c4021993d8cbe2a01ae4410c2042a02daaa44 100644 (file)
@@ -149,9 +149,8 @@ static void update_pv_status(lvmetad_state *s, struct config_tree *vg)
        lock_pvs(s);
        struct config_node *pv = pvs(vg);
        while (pv) {
-               const char *uuid = find_config_str(pv->child, "id", "N/A");
-               const char *vgid = find_config_str(vg->root, "metadata/id", "N/A");
-               int found = dm_hash_lookup(s->pvs, uuid) ? 1 : 0;
+               const char *uuid = find_config_str(pv->child, "id", NULL);
+               int found = uuid ? (dm_hash_lookup(s->pvs, uuid) ? 1 : 0) : 0;
                // TODO: avoid the override here if MISSING came from the actual
                // metadata, as opposed from our manipulation...
                set_flag(vg, pv, "status", "MISSING", !found);
This page took 0.035936 seconds and 5 git commands to generate.