1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

lvmetad: cleanup

Avoid hashing insertion when object with same content is already there.
This commit is contained in:
Zdenek Kabelac 2017-07-16 22:28:50 +02:00
parent 767a5e1281
commit 567aa60fa1

View File

@ -808,7 +808,8 @@ static int _update_pvid_to_vgid(lvmetad_state *s, struct dm_config_tree *vg,
if ((mode == REMOVE_EMPTY) && vgid_old) { if ((mode == REMOVE_EMPTY) && vgid_old) {
/* This copies the vgid_old string, doesn't reference it. */ /* This copies the vgid_old string, doesn't reference it. */
if (!dm_hash_insert(to_check, vgid_old, (void*) 1)) { if ((dm_hash_lookup(to_check, vgid_old) != (void*) 1) &&
!dm_hash_insert(to_check, vgid_old, (void*) 1)) {
ERROR(s, "update_pvid_to_vgid out of memory for hash insert vgid_old %s", vgid_old); ERROR(s, "update_pvid_to_vgid out of memory for hash insert vgid_old %s", vgid_old);
goto abort_daemon; goto abort_daemon;
} }