From cd501dd4404c49dbfa10b02ea24cb88283fc8470 Mon Sep 17 00:00:00 2001 From: Milan Broz Date: Tue, 24 Nov 2009 16:11:37 +0000 Subject: [PATCH] Move persistent filter dump to more appropriate place. After context_refresh is cache empty, the cache flush does nothing. Call it after lvmcache full rescan if running from log lived process. --- WHATS_NEW | 1 + lib/cache/lvmcache.c | 8 ++++++++ lib/commands/toolcontext.c | 7 ------- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index 30be5a0d4..e1eb88808 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.56 - ==================================== + Move persistent filter dump to more appropriate place. Refresh device filters before full device rescan in lvmcache. Return error status if vgchange fails to activate some volume. Fix memory lock imbalance in locking code. diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c index bfb714c5d..672b4b1ca 100644 --- a/lib/cache/lvmcache.c +++ b/lib/cache/lvmcache.c @@ -20,6 +20,7 @@ #include "locking.h" #include "metadata.h" #include "filter.h" +#include "filter-persistent.h" #include "memlock.h" #include "str_list.h" #include "format-text.h" @@ -533,6 +534,13 @@ int lvmcache_label_scan(struct cmd_context *cmd, int full_scan) goto out; } + /* + * If we are a long-lived process, write out the updated persistent + * device cache for the benefit of short-lived processes. + */ + if (full_scan == 2 && cmd->is_long_lived && cmd->dump_filter) + persistent_filter_dump(cmd->filter); + r = 1; out: diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c index 721c2cfd1..80b6f8f03 100644 --- a/lib/commands/toolcontext.c +++ b/lib/commands/toolcontext.c @@ -1291,13 +1291,6 @@ int refresh_toolcontext(struct cmd_context *cmd) if (!_init_segtypes(cmd)) return 0; - /* - * If we are a long-lived process, write out the updated persistent - * device cache for the benefit of short-lived processes. - */ - if (cmd->is_long_lived && cmd->dump_filter) - persistent_filter_dump(cmd->filter); - cmd->config_valid = 1; reset_lvm_errno(1);