diff options
author | Petr Rockai <prockai@redhat.com> | 2011-07-20 21:26:18 +0000 |
---|---|---|
committer | Petr Rockai <prockai@redhat.com> | 2011-07-20 21:26:18 +0000 |
commit | fba6c62b84bd3e75bbde8a678cc310281c88b08b (patch) | |
tree | 6e124c106526edea00037fee522c4c3f088e97e4 /daemons/lvmetad/lvmetad-core.c | |
parent | 0cfb99d3851a018a1f8af3829ae9800015b560f7 (diff) | |
download | lvm2-fba6c62b84bd3e75bbde8a678cc310281c88b08b.tar.gz lvm2-fba6c62b84bd3e75bbde8a678cc310281c88b08b.tar.xz lvm2-fba6c62b84bd3e75bbde8a678cc310281c88b08b.zip |
lvmetad: Robustify update_pv_status and remove an useless lookup.
Diffstat (limited to 'daemons/lvmetad/lvmetad-core.c')
-rw-r--r-- | daemons/lvmetad/lvmetad-core.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/daemons/lvmetad/lvmetad-core.c b/daemons/lvmetad/lvmetad-core.c index 56f9a7fc..a30c4021 100644 --- a/daemons/lvmetad/lvmetad-core.c +++ b/daemons/lvmetad/lvmetad-core.c @@ -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); |