1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

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.
This commit is contained in:
Zdenek Kabelac 2014-04-07 20:33:50 +02:00
parent 43f849296e
commit 9eab84aa2b

View File

@ -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)))