From 2b249a6ee51a79a5c28ffa591069158fd2c50e53 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Thu, 30 Jan 2025 19:55:21 +0100 Subject: [PATCH 30/30] vg_read: correct error path for DM cache update New code for updating DM cache traveled through couple destination however in this place only 'return_0' is missing unlocking in error path. (cherry picked from commit 46a48f1320c9d436286743461cd6e12d38ec45e0) --- lib/metadata/metadata.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c index 14f54db23..b4da74247 100644 --- a/lib/metadata/metadata.c +++ b/lib/metadata/metadata.c @@ -5035,8 +5035,11 @@ struct volume_group *vg_read(struct cmd_context *cmd, const char *vg_name, const * TODO: do a lazy-update of this cache, only when it's really used */ if (dm_devs_cache_use()) { log_debug_cache("Rescanning DM cache."); - if (!dm_devs_cache_update()) - return_0; + if (!dm_devs_cache_update()) { + log_error("Can't allocate DM cache memory for VG %s.", vg_name); + failure |= FAILED_ALLOCATION; + goto bad; + } } /* -- 2.48.1