mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-18 10:04:20 +03:00
lvmetad: Fix pvmeta_old_{pvid,dev} logic when they are the same.
This commit is contained in:
parent
67c539f346
commit
551b6b7998
@ -883,22 +883,22 @@ static response pv_found(lvmetad_state *s, request r)
|
|||||||
|
|
||||||
lock_pvid_to_pvmeta(s);
|
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)))) {
|
if ((old = dm_hash_lookup_binary(s->device_to_pvid, &device, sizeof(device)))) {
|
||||||
pvmeta_old_dev = dm_hash_lookup(s->pvid_to_pvmeta, old);
|
pvmeta_old_dev = dm_hash_lookup(s->pvid_to_pvmeta, old);
|
||||||
dm_hash_remove(s->pvid_to_pvmeta, old);
|
dm_hash_remove(s->pvid_to_pvmeta, old);
|
||||||
vgid_old = dm_hash_lookup(s->pvid_to_vgid, 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",
|
DEBUGLOG(s, "pv_found %s, vgid = %s, device = %" PRIu64 " (previously %" PRIu64 "), old = %s",
|
||||||
pvid, vgid, device, device_old_pvid, old);
|
pvid, vgid, device, device_old_pvid, old);
|
||||||
|
|
||||||
if (!(cft->root = dm_config_clone_node(cft, pvmeta, 0)))
|
if (!(cft->root = dm_config_clone_node(cft, pvmeta, 0)))
|
||||||
goto out_of_mem;
|
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;
|
changed |= 1;
|
||||||
|
|
||||||
if (pvmeta_old_pvid && device != device_old_pvid) {
|
if (pvmeta_old_pvid && device != device_old_pvid) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user