diff --git a/WHATS_NEW b/WHATS_NEW index 0fee2fa1b..1401be7fa 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.54 - ===================================== + Fix clvmd segfault when refresh_toolcontext fails. Remember to clear 'global lock held during cache refresh' state after use. Use udev flags support in LVM. Delay announcing mirror monitoring to syslog until initialisation succeeded. diff --git a/daemons/clvmd/lvm-functions.c b/daemons/clvmd/lvm-functions.c index a974fadf3..e56d11b4b 100644 --- a/daemons/clvmd/lvm-functions.c +++ b/daemons/clvmd/lvm-functions.c @@ -601,20 +601,23 @@ int do_check_lvm1(const char *vgname) int do_refresh_cache() { - int ret; DEBUGLOG("Refreshing context\n"); log_notice("Refreshing context"); pthread_mutex_lock(&lvm_lock); - ret = refresh_toolcontext(cmd); + if (!refresh_toolcontext(cmd)) { + pthread_mutex_unlock(&lvm_lock); + return -1; + } + init_full_scan_done(0); lvmcache_label_scan(cmd, 2); dm_pool_empty(cmd->mem); pthread_mutex_unlock(&lvm_lock); - return ret==1?0:-1; + return 0; }