diff --git a/WHATS_NEW b/WHATS_NEW index 76e203dde..6980e17fb 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.165 - =================================== + Do not monitor cache-pool metadata when LV is just being cleared. Add allocation/cache_pool_max_chunks to prevent misuse of cache target. Give error not segfault in lvconvert --splitmirrors when PV lies outside LV. Fix typo in report/columns_as_rows config option name recognition (2.02.99). diff --git a/lib/activate/activate.c b/lib/activate/activate.c index f4d3a1740..997729124 100644 --- a/lib/activate/activate.c +++ b/lib/activate/activate.c @@ -1723,6 +1723,23 @@ int monitor_dev_for_events(struct cmd_context *cmd, const struct logical_volume if (monitor && !dmeventd_monitor_mode()) return 1; + /* + * Activation of unused cache-pool activates metadata device as + * a public LV for clearing purpose. + * FIXME: + * As VG lock is held across whole operation unmonitored volume + * is usually OK since dmeventd couldn't do anything. + * However in case command would have crashed, such LV is + * left unmonitored and may potentially require dmeventd. + */ + if ((lv_is_cache_pool_data(lv) || lv_is_cache_pool_metadata(lv)) && + !lv_is_used_cache_pool((find_pool_seg(first_seg(lv))->lv))) { + log_debug_activation("Skipping %smonitor of %s.%s", + (monitor) ? "" : "un", display_lvname(lv), + (monitor) ? " Cache pool activation for clearing only." : ""); + return 1; + } + /* * Allow to unmonitor thin pool via explicit pool unmonitor * or unmonitor before the last thin pool user deactivation