1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

lvmetad: Fix a corruption-prone race in error path.

This commit is contained in:
Petr Rockai 2014-01-07 03:04:14 +01:00
parent 087d33d73b
commit 89e7d81d92

View File

@ -903,8 +903,8 @@ static response pv_found(lvmetad_state *s, request r)
if (!dm_hash_insert(s->pvid_to_pvmeta, pvid, cft) ||
!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);
unlock_pvid_to_pvmeta(s);
dm_config_destroy(cft);
dm_free(pvid_dup);
return reply_fail("out of memory");