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

lvmetad: Fix pvmeta_old_{pvid,dev} logic when they are the same.

This commit is contained in:
Petr Rockai 2014-03-14 10:06:27 +01:00
parent 67c539f346
commit 551b6b7998

View File

@ -883,22 +883,22 @@ static response pv_found(lvmetad_state *s, request r)
lock_pvid_to_pvmeta(s);
if ((pvmeta_old_pvid = dm_hash_lookup(s->pvid_to_pvmeta, pvid)))
dm_config_get_uint64(pvmeta_old_pvid->root, "pvmeta/device", &device_old_pvid);
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);
vgid_old = dm_hash_lookup(s->pvid_to_vgid, old);
}
if ((pvmeta_old_pvid = dm_hash_lookup(s->pvid_to_pvmeta, pvid)))
dm_config_get_uint64(pvmeta_old_pvid->root, "pvmeta/device", &device_old_pvid);
DEBUGLOG(s, "pv_found %s, vgid = %s, device = %" PRIu64 " (previously %" PRIu64 "), old = %s",
pvid, vgid, device, device_old_pvid, old);
if (!(cft->root = dm_config_clone_node(cft, pvmeta, 0)))
goto out_of_mem;
if (pvmeta_old_pvid && compare_config(pvmeta_old_pvid->root, cft->root))
if (!pvmeta_old_pvid || compare_config(pvmeta_old_pvid->root, cft->root))
changed |= 1;
if (pvmeta_old_pvid && device != device_old_pvid) {