diff --git a/WHATS_NEW b/WHATS_NEW index 5051d36cd..30be5a0d4 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.56 - ==================================== + 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. Revert vg_read_internal change, clvmd cannot use vg_read now. (2.02.55) diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c index dc391c8af..bfb714c5d 100644 --- a/lib/cache/lvmcache.c +++ b/lib/cache/lvmcache.c @@ -510,6 +510,11 @@ int lvmcache_label_scan(struct cmd_context *cmd, int full_scan) goto out; } + if (full_scan == 2 && !refresh_filters(cmd)) { + log_error("refresh filters failed"); + goto out; + } + if (!(iter = dev_iter_create(cmd->filter, (full_scan == 2) ? 1 : 0))) { log_error("dev_iter creation failed"); goto out; diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c index 83485d4ce..721c2cfd1 100644 --- a/lib/commands/toolcontext.c +++ b/lib/commands/toolcontext.c @@ -1223,6 +1223,16 @@ skip_dlclose: } } +int refresh_filters(struct cmd_context *cmd) +{ + if (cmd->filter) { + cmd->filter->destroy(cmd->filter); + cmd->filter = NULL; + } + + return _init_filters(cmd, 0); +} + int refresh_toolcontext(struct cmd_context *cmd) { log_verbose("Reloading config files"); diff --git a/lib/commands/toolcontext.h b/lib/commands/toolcontext.h index aa3de1493..2ffc86d9d 100644 --- a/lib/commands/toolcontext.h +++ b/lib/commands/toolcontext.h @@ -105,6 +105,7 @@ struct cmd_context *create_toolcontext(unsigned is_long_lived, const char *system_dir); void destroy_toolcontext(struct cmd_context *cmd); int refresh_toolcontext(struct cmd_context *cmd); +int refresh_filters(struct cmd_context *cmd); int config_files_changed(struct cmd_context *cmd); int init_lvmcache_orphans(struct cmd_context *cmd);