From 9eab84aa2b4cf97f931f0291b3f690cdceaa1e75 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Mon, 7 Apr 2014 20:33:50 +0200 Subject: [PATCH] debug: catch invalid request for tree In general for non-toplevel LVs we shouldn't allow any _tree_action. For now error on request for cache_pool activation which doesn't even exist in dm-table. --- lib/activate/dev_manager.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c index cde39af37..fb9625d5e 100644 --- a/lib/activate/dev_manager.c +++ b/lib/activate/dev_manager.c @@ -2786,6 +2786,12 @@ static int _tree_action(struct dev_manager *dm, struct logical_volume *lv, char *dlid; int r = 0; + /* Some LV can be used for top level tree */ + /* TODO: add more.... */ + if (lv_is_cache_pool(lv)) { + log_error(INTERNAL_ERROR "Cannot create tree for %s.", lv->name); + return 0; + } /* Some targets may build bigger tree for activation */ dm->activation = ((action == PRELOAD) || (action == ACTIVATE)); if (!(dtree = _create_partial_dtree(dm, lv, laopts->origin_only)))