diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2016-12-18 15:05:31 +0100 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2016-12-18 19:30:50 +0100 |
commit | 69434c2eca5bb7667d73916a28d03b8c687aea32 (patch) | |
tree | 7ef6d6c4606f085bb9d90dc45ebba17f6e50392e | |
parent | 954c59779d35436a6d2f28482ec1ed6dc128844c (diff) | |
download | lvm2-69434c2eca5bb7667d73916a28d03b8c687aea32.tar.gz |
cache: improve activation with -real
When cache volume may be converted from normal to -real layer LV
we need to improve logic for call cache_check.
With this patch, we register call for cache_check only when metadata LV
is not yet present in active table slot (should match initial table
load).
This avoids unwanted checking when cache would become layer device
online.
-rw-r--r-- | WHATS_NEW | 1 | ||||
-rw-r--r-- | lib/activate/dev_manager.c | 4 |
2 files changed, 5 insertions, 0 deletions
@@ -1,5 +1,6 @@ Version 2.02.169 - ===================================== + Support cache volume activation with -real layer. Improve search of lock-holder for external origin and thin-pool. Support status checking of cache volume used in layer. Avoid shifting by one number of blocks when clearing dirty cache volume. diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c index 8245454db..520a0a191 100644 --- a/lib/activate/dev_manager.c +++ b/lib/activate/dev_manager.c @@ -2901,6 +2901,10 @@ static int _add_new_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree, return_0; if (lv_is_cache(lv) && + /* Register callback only for layer activation or non-layered cache LV */ + (layer || !lv_layer(lv)) && + /* Register callback when metadata LV is NOT already active */ + !_cached_dm_info(dm->mem, dtree, first_seg(first_seg(lv)->pool_lv)->metadata_lv, NULL) && !_pool_register_callback(dm, dnode, lv)) return_0; |