From fae1a611d2f907aa23c237b9f84df5089d30f728 Mon Sep 17 00:00:00 2001 From: Petr Rockai Date: Mon, 17 Dec 2012 00:39:00 +0100 Subject: [PATCH] lvmetad: Fix a possible deadlock. If an update and a query were running in parallel, there was a slim but non-zero chance of a deadlock due to (unnecessary) mutex nesting. --- daemons/lvmetad/lvmetad-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemons/lvmetad/lvmetad-core.c b/daemons/lvmetad/lvmetad-core.c index 4e0266216..674ddea87 100644 --- a/daemons/lvmetad/lvmetad-core.c +++ b/daemons/lvmetad/lvmetad-core.c @@ -671,8 +671,8 @@ static int update_metadata(lvmetad_state *s, const char *name, const char *_vgid lock_vgid_to_metadata(s); old = dm_hash_lookup(s->vgid_to_metadata, _vgid); - lock_vg(s, _vgid); unlock_vgid_to_metadata(s); + lock_vg(s, _vgid); seq = dm_config_find_int(metadata, "metadata/seqno", -1); -- 2.43.5