1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

cache: do not monitor cache-pool

Avoid monitoring of activated cache-pool - where the only purpose ATM
is to clear metadata volume which is actually activate in place
of cache-pool name (using public LV name).

Since VG lock is held across whole clear operation, dmeventd cannot
be used anyway - however in case of appliction crash we may
leave unmonitored device.

In future we may provide better mechanism as the current name
replacemnet is creating 'uncommon' table setups in case the metadata
LV is more complex type like raid  (needs some futher thinking about
error path results).

Another point to think about is the fact we should not clear device
while holding lock (i.e. dmeventd mirror repair cannot work in cases
like this).
This commit is contained in:
Zdenek Kabelac 2016-08-24 10:05:09 +02:00
parent b493811968
commit 81970d22d8
2 changed files with 18 additions and 0 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.165 - 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. Add allocation/cache_pool_max_chunks to prevent misuse of cache target.
Give error not segfault in lvconvert --splitmirrors when PV lies outside LV. 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). Fix typo in report/columns_as_rows config option name recognition (2.02.99).

View File

@ -1723,6 +1723,23 @@ int monitor_dev_for_events(struct cmd_context *cmd, const struct logical_volume
if (monitor && !dmeventd_monitor_mode()) if (monitor && !dmeventd_monitor_mode())
return 1; 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 * Allow to unmonitor thin pool via explicit pool unmonitor
* or unmonitor before the last thin pool user deactivation * or unmonitor before the last thin pool user deactivation