mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
lvmetad: Fix a corruption-prone race in error path.
This commit is contained in:
parent
087d33d73b
commit
89e7d81d92
@ -903,8 +903,8 @@ static response pv_found(lvmetad_state *s, request r)
|
|||||||
|
|
||||||
if (!dm_hash_insert(s->pvid_to_pvmeta, pvid, cft) ||
|
if (!dm_hash_insert(s->pvid_to_pvmeta, pvid, cft) ||
|
||||||
!dm_hash_insert_binary(s->device_to_pvid, &device, sizeof(device), (void*)pvid_dup)) {
|
!dm_hash_insert_binary(s->device_to_pvid, &device, sizeof(device), (void*)pvid_dup)) {
|
||||||
unlock_pvid_to_pvmeta(s);
|
|
||||||
dm_hash_remove(s->pvid_to_pvmeta, pvid);
|
dm_hash_remove(s->pvid_to_pvmeta, pvid);
|
||||||
|
unlock_pvid_to_pvmeta(s);
|
||||||
dm_config_destroy(cft);
|
dm_config_destroy(cft);
|
||||||
dm_free(pvid_dup);
|
dm_free(pvid_dup);
|
||||||
return reply_fail("out of memory");
|
return reply_fail("out of memory");
|
||||||
|
Loading…
Reference in New Issue
Block a user