summaryrefslogtreecommitdiff
path: root/lib/activate
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2021-07-14 12:53:47 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2021-07-14 12:56:08 +0200
commitd38fdb25e4debc035f1e4585432c2627460d5e50 (patch)
tree8f3bbd4cafcbb8c1000e9680753d648077da1130 /lib/activate
parente33c2e032cab40cf8607afa1cb92176400d1cabd (diff)
downloadlvm2-d38fdb25e4debc035f1e4585432c2627460d5e50.tar.gz
thin: fix component detection of external origin
When check active componet of thinLV with external origin, we need to check if the external origin isn't already active. For this however we need to use layered check for -real device.
Diffstat (limited to 'lib/activate')
-rw-r--r--lib/activate/activate.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/activate/activate.c b/lib/activate/activate.c
index 6bda7385b..94fc9441d 100644
--- a/lib/activate/activate.c
+++ b/lib/activate/activate.c
@@ -2740,7 +2740,10 @@ static int _component_cb(struct logical_volume *lv, void *data)
(lv_is_thin_pool(lv) && pool_is_active(lv)))
return -1;
- if (lv_is_active(lv)) {
+ /* External origin is activated through thinLV and uses -real suffix.
+ * Note: for old clustered logic we would need to check for all thins */
+ if ((lv_is_external_origin(lv) && lv_info(lv->vg->cmd, lv, 1, NULL, 0, 0)) ||
+ lv_is_active(lv)) {
if (!lv_is_component(lv) || lv_is_visible(lv))
return -1; /* skip whole subtree */