master - tests: test stacked raid
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d021284bcfda02...
Commit: d021284bcfda0222f10787ea798077f312ee3275
Parent: 2055b04c111eb5df3a445a9b544aff7a17b411a1
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jan 30 12:30:35 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jan 30 12:33:52 2015 +0100
tests: test stacked raid
---
test/shell/lvconvert-thin-raid.sh | 26 +++++++++++++++++++++++---
1 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/test/shell/lvconvert-thin-raid.sh b/test/shell/lvconvert-thin-raid.sh
index d7a353b..3d7eee5 100644
--- a/test/shell/lvconvert-thin-raid.sh
+++ b/test/shell/lvconvert-thin-raid.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright (C) 2014 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2014-2015 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
@@ -18,8 +18,10 @@ aux have_raid 1 4 0 || skip
aux prepare_vg 4
# create RAID LVs for data and metadata volumes
-lvcreate -aey --nosync -L10M --type raid1 -m1 -n $lv1 $vg
-lvcreate -aey --nosync -L8M --type raid1 -m1 -n $lv2 $vg
+lvcreate -aey -L10M --type raid1 -m3 -n $lv1 $vg
+lvcreate -aey -L8M --type raid1 -m3 -n $lv2 $vg
+aux wait_for_sync $vg $lv1
+aux wait_for_sync $vg $lv2
lvchange -an $vg/$lv1
# conversion fails for internal volumes
@@ -28,4 +30,22 @@ invalid lvconvert --yes --thinpool $vg/$lv1 --poolmetadata $vg/${lv2}_rimage_0
lvconvert --yes --thinpool $vg/$lv1 --poolmetadata $vg/$lv2
+lvchange -ay $vg
+
+lvconvert --splitmirrors 1 --name data2 $vg/${lv1}_tdata "$dev2"
+lvconvert --splitmirrors 1 --name data3 $vg/${lv1}_tdata "$dev3"
+lvconvert --splitmirrors 1 --trackchanges $vg/${lv1}_tdata "$dev4"
+
+lvconvert --splitmirrors 1 --name meta1 $vg/${lv1}_tmeta "$dev1"
+lvconvert --splitmirrors 1 --name meta2 $vg/${lv1}_tmeta "$dev2"
+lvconvert --splitmirrors 1 --trackchanges $vg/${lv1}_tmeta "$dev4"
+
+lvremove -ff $vg/data2 $vg/data3 $vg/meta1 $vg/meta2
+
+lvconvert --merge $vg/${lv1}_tdata_rimage_1
+lvconvert --merge $vg/${lv1}_tmeta_rimage_1
+
+lvconvert -m+1 $vg/${lv1}_tdata "$dev2"
+lvconvert -m+1 $vg/${lv1}_tmeta "$dev1"
+
vgremove -ff $vg
9 years, 2 months
master - cleanup: indent tabs
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2055b04c111eb5...
Commit: 2055b04c111eb5df3a445a9b544aff7a17b411a1
Parent: 2e35c681222c18980ea818951bf41199f895ccda
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jan 30 12:27:16 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jan 30 12:33:52 2015 +0100
cleanup: indent tabs
---
lib/metadata/metadata.h | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/metadata/metadata.h b/lib/metadata/metadata.h
index f8a11c9..75abf63 100644
--- a/lib/metadata/metadata.h
+++ b/lib/metadata/metadata.h
@@ -434,8 +434,9 @@ int for_each_sub_lv_except_pools(struct logical_volume *lv,
int (*fn)(struct logical_volume *lv, void *data),
void *data);
int for_each_sub_lv(struct logical_volume *lv,
- int (*fn)(struct logical_volume *lv, void *data),
- void *data);
+ int (*fn)(struct logical_volume *lv, void *data),
+ void *data);
+
int move_lv_segments(struct logical_volume *lv_to,
struct logical_volume *lv_from,
uint64_t set_status, uint64_t reset_status);
9 years, 2 months
master - lv_manip: add for_each_sub_lv_except_pools()
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2e35c681222c18...
Commit: 2e35c681222c18980ea818951bf41199f895ccda
Parent: c35503e0f74968224e71d79b4359d32af5bdea93
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jan 30 12:27:49 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jan 30 12:33:52 2015 +0100
lv_manip: add for_each_sub_lv_except_pools()
for_each_sub_lv() now scans in depth also pools, however for
rename we actually do want to skip pools.
So add a new for_each_sub_lv_except_pools() to be used by rename,
every other user of for_each_sub_lv() scans every sub LV with pools
included.
This is i.e. necessary for properly working preload of pools
that are using raid arrays.
---
WHATS_NEW | 1 +
lib/metadata/lv_manip.c | 29 +++++++++++++++++++++++++----
lib/metadata/metadata.h | 3 +++
3 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 474cd24..401c8b9 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.116 -
====================================
+ Scan pools in for_each_sub_lv() and add for_each_sub_lv_except_pools().
Fix lvm2app lvm_lv_get_property return value for fields with info/status ioctl.
Fix lvm2app regression in lvm_lv_get_attr causing unknown values (2.02.115).
Set default cache_mode to writehrough when missing in metadata.
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 8a3b779..0fcf7c2 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -3883,9 +3883,9 @@ static int _rename_cb(struct logical_volume *lv, void *data)
* Loop down sub LVs and call fn for each.
* fn is responsible to log necessary information on failure.
*/
-int for_each_sub_lv(struct logical_volume *lv,
- int (*fn)(struct logical_volume *lv, void *data),
- void *data)
+static int _for_each_sub_lv(struct logical_volume *lv, int skip_pools,
+ int (*fn)(struct logical_volume *lv, void *data),
+ void *data)
{
struct logical_volume *org;
struct lv_segment *seg;
@@ -3913,6 +3913,13 @@ int for_each_sub_lv(struct logical_volume *lv,
return_0;
}
+ if (seg->pool_lv && !skip_pools) {
+ if (!fn(seg->pool_lv, data))
+ return_0;
+ if (!for_each_sub_lv(seg->pool_lv, fn, data))
+ return_0;
+ }
+
for (s = 0; s < seg->area_count; s++) {
if (seg_type(seg, s) != AREA_LV)
continue;
@@ -3939,6 +3946,20 @@ int for_each_sub_lv(struct logical_volume *lv,
return 1;
}
+int for_each_sub_lv(struct logical_volume *lv,
+ int (*fn)(struct logical_volume *lv, void *data),
+ void *data)
+{
+ return _for_each_sub_lv(lv, 0, fn, data);
+}
+
+int for_each_sub_lv_except_pools(struct logical_volume *lv,
+ int (*fn)(struct logical_volume *lv, void *data),
+ void *data)
+{
+ return _for_each_sub_lv(lv, 1, fn, data);
+}
+
/*
* Core of LV renaming routine.
* VG must be locked by caller.
@@ -3975,7 +3996,7 @@ int lv_rename_update(struct cmd_context *cmd, struct logical_volume *lv,
}
/* rename sub LVs */
- if (!for_each_sub_lv(lv, _rename_cb, (void *) &lv_names))
+ if (!for_each_sub_lv_except_pools(lv, _rename_cb, (void *) &lv_names))
return_0;
/* rename main LV */
diff --git a/lib/metadata/metadata.h b/lib/metadata/metadata.h
index 48c1b3c..f8a11c9 100644
--- a/lib/metadata/metadata.h
+++ b/lib/metadata/metadata.h
@@ -430,6 +430,9 @@ int lv_split_segment(struct logical_volume *lv, uint32_t le);
int add_seg_to_segs_using_this_lv(struct logical_volume *lv, struct lv_segment *seg);
int remove_seg_from_segs_using_this_lv(struct logical_volume *lv, struct lv_segment *seg);
+int for_each_sub_lv_except_pools(struct logical_volume *lv,
+ int (*fn)(struct logical_volume *lv, void *data),
+ void *data);
int for_each_sub_lv(struct logical_volume *lv,
int (*fn)(struct logical_volume *lv, void *data),
void *data);
9 years, 2 months
master - WHATS_NEW: previous commit
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c35503e0f74968...
Commit: c35503e0f74968224e71d79b4359d32af5bdea93
Parent: 8650404df1884f1e040aad4343c8db0eac71e125
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Jan 30 11:28:10 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Jan 30 11:28:10 2015 +0100
WHATS_NEW: previous commit
---
WHATS_NEW | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 62f03ef..474cd24 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.116 -
====================================
+ Fix lvm2app lvm_lv_get_property return value for fields with info/status ioctl.
Fix lvm2app regression in lvm_lv_get_attr causing unknown values (2.02.115).
Set default cache_mode to writehrough when missing in metadata.
Preserve chunk size with repair and metadata swap of a thin pool.
9 years, 2 months
master - properties: also recognize LVSINFO, LVSSTATUS and LVSINFOSTATUS as subtypes of LVS
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8650404df1884f...
Commit: 8650404df1884f1e040aad4343c8db0eac71e125
Parent: 531cc58d899b7dd1421bfe83f5503aa266390334
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Jan 30 11:13:49 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Jan 30 11:13:49 2015 +0100
properties: also recognize LVSINFO, LVSSTATUS and LVSINFOSTATUS as subtypes of LVS
LVSINFO, LVSSTATUS and LVSINFOSTATUS is the same as LVS, just with some
extra info/status decoration attached to it. Recognize this when looking
for properties for lvm2app. This fixes lvm_lv_get_property lvm2app call
for fields which already use LVS{INFO,STATUS,INFOSTATUS} - currently,
this is lv_attr field which was converted to LVSINFOSTATUS from
pure LVS type.
---
lib/report/properties.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/report/properties.c b/lib/report/properties.c
index 8866928..c1c9563 100644
--- a/lib/report/properties.c
+++ b/lib/report/properties.c
@@ -476,7 +476,7 @@ int lvseg_get_property(const struct lv_segment *lvseg,
int lv_get_property(const struct logical_volume *lv,
struct lvm_property_type *prop)
{
- return prop_get_property(_properties, lv, prop, LVS);
+ return prop_get_property(_properties, lv, prop, LVS | LVSINFO | LVSSTATUS | LVSINFOSTATUS);
}
int vg_get_property(const struct volume_group *vg,
@@ -500,7 +500,7 @@ int pv_get_property(const struct physical_volume *pv,
int lv_set_property(struct logical_volume *lv,
struct lvm_property_type *prop)
{
- return prop_set_property(_properties, lv, prop, LVS);
+ return prop_set_property(_properties, lv, prop, LVS | LVSINFO | LVSSTATUS | LVSINFOSTATUS);
}
int vg_set_property(struct volume_group *vg,
9 years, 2 months
master - lvm2app: fix lvm_lv_get_attr regression causing unknown values
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=531cc58d899b7d...
Commit: 531cc58d899b7dd1421bfe83f5503aa266390334
Parent: 8dc1da2cbed42e9c5a4dee5b342bb4aff8c9d9a3
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Jan 30 09:45:22 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Jan 30 09:53:34 2015 +0100
lvm2app: fix lvm_lv_get_attr regression causing unknown values
This is a regression from v115 where some of the fields/properties
were converted to using the common "struct lvinfo" and
"struct lv_seg_status" so we don't need to issue info and status
ioctl several times per one reported line. Not all fields are
converted yet, but one that *is* converted is the lv_attr field
with the lv_attr_dup counterpart used in lvm_lv_get_attr lvm2app fn.
These changes were introduced with e34b004422f0d51263e0d34f4064556cfc9148f6
and later - this patch introduced the "info_ok" field in the
lv_with_info_and_seg_status structure which encapsulates the lvinfo
and lv_seg_status struct.
For the lv_attr_dup, the lv_attr_dup code missed the
assignment for the "info_ok" flag which saves the result of the
lv_info_with_seg_status call. Hence such info was marked
as unusable - unknown and it was returned as such via lvm_lv_get_attr
lvm2app fn.
---
WHATS_NEW | 1 +
lib/metadata/lv.c | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index f2546a9..62f03ef 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.116 -
====================================
+ Fix lvm2app regression in lvm_lv_get_attr causing unknown values (2.02.115).
Set default cache_mode to writehrough when missing in metadata.
Preserve chunk size with repair and metadata swap of a thin pool.
Fix raid --splitmirror 1 functionality (2.02.112).
diff --git a/lib/metadata/lv.c b/lib/metadata/lv.c
index 9052e63..c3c5d4a 100644
--- a/lib/metadata/lv.c
+++ b/lib/metadata/lv.c
@@ -831,7 +831,7 @@ char *lv_attr_dup(struct dm_pool *mem, const struct logical_volume *lv)
if (!(status.seg_status.mem = dm_pool_create("reporter_pool", 1024)))
return_0;
- if (!lv_info_with_seg_status(lv->vg->cmd, lv, first_seg(lv), 1, &status, 1, 1))
+ if (!(status.info_ok = lv_info_with_seg_status(lv->vg->cmd, lv, first_seg(lv), 1, &status, 1, 1)))
goto_bad;
ret = lv_attr_dup_with_info_and_seg_status(mem, &status);
9 years, 2 months
master - cache: use writethrough cache_mode for older metadata
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8dc1da2cbed42e...
Commit: 8dc1da2cbed42e9c5a4dee5b342bb4aff8c9d9a3
Parent: bfeabea631782b3f0b8ec6494c4490663c412774
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Jan 29 12:05:58 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jan 29 12:05:58 2015 +0100
cache: use writethrough cache_mode for older metadata
When cache_mode is undefined, the read of metadata will miss to
set a bit with mode and fails to process metadata on internal
error:
Internal error: LV vg/lvol1 has uknown feature flags 0.
Fix it by setting it to writethrough mode.
---
WHATS_NEW | 1 +
lib/cache_segtype/cache.c | 4 +++-
2 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 92b62a6..f2546a9 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.116 -
====================================
+ Set default cache_mode to writehrough when missing in metadata.
Preserve chunk size with repair and metadata swap of a thin pool.
Fix raid --splitmirror 1 functionality (2.02.112).
Fix tree preload to handle splitting raid images.
diff --git a/lib/cache_segtype/cache.c b/lib/cache_segtype/cache.c
index 73839f4..afc0ec6 100644
--- a/lib/cache_segtype/cache.c
+++ b/lib/cache_segtype/cache.c
@@ -68,7 +68,9 @@ static int _cache_pool_text_import(struct lv_segment *seg,
return SEG_LOG_ERROR("cache_mode must be a string in");
if (!set_cache_pool_feature(&seg->feature_flags, str))
return SEG_LOG_ERROR("Unknown cache_mode in");
- }
+ } else
+ /* When missed in metadata, it's an old stuff - use writethrough */
+ seg->feature_flags |= DM_CACHE_FEATURE_WRITETHROUGH;
if (dm_config_has_node(sn, "policy")) {
if (!(str = dm_config_find_str(sn, "policy", NULL)))
9 years, 3 months
master - cache: use built-in define for cache_mode
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f654139e6870ff...
Commit: f654139e6870ff1ce15238ce19842921449273fc
Parent: bfeabea631782b3f0b8ec6494c4490663c412774
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Jan 29 11:53:30 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jan 29 11:53:30 2015 +0100
cache: use built-in define for cache_mode
When cache_mode is undefined, the read of metadata will miss to
set a bit with mode and fails to process metadata on internal
error:
Internal error: LV vg/lvol1 has uknown feature flags 0.
Fix it by using compile time DEFAULTS.
---
WHATS_NEW | 1 +
lib/cache_segtype/cache.c | 3 ++-
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 92b62a6..2a58a8b 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.116 -
====================================
+ Set default cache_mode when unset/missing in metadata.
Preserve chunk size with repair and metadata swap of a thin pool.
Fix raid --splitmirror 1 functionality (2.02.112).
Fix tree preload to handle splitting raid images.
diff --git a/lib/cache_segtype/cache.c b/lib/cache_segtype/cache.c
index 73839f4..5de7baf 100644
--- a/lib/cache_segtype/cache.c
+++ b/lib/cache_segtype/cache.c
@@ -68,7 +68,8 @@ static int _cache_pool_text_import(struct lv_segment *seg,
return SEG_LOG_ERROR("cache_mode must be a string in");
if (!set_cache_pool_feature(&seg->feature_flags, str))
return SEG_LOG_ERROR("Unknown cache_mode in");
- }
+ } else if (!set_cache_pool_feature(&seg->feature_flags, DEFAULT_CACHE_POOL_CACHEMODE))
+ return SEG_LOG_ERROR(INTERNAL_ERROR "Unknown built-in cache_mode");
if (dm_config_has_node(sn, "policy")) {
if (!(str = dm_config_find_str(sn, "policy", NULL)))
9 years, 3 months
master - cache: use built-in define for cache_mode
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=84557040129b28...
Commit: 84557040129b284c50f68124b4b3eeb5497baeb6
Parent: bfeabea631782b3f0b8ec6494c4490663c412774
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Jan 29 11:47:00 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jan 29 11:49:27 2015 +0100
cache: use built-in define for cache_mode
When cache_mode is undefined, the read of metadata will miss to
set a bit with mode and fails to process metadata on internal
error:
Internal error: LV vg/lvol1 has uknown feature flags 0.
Fix it by using compile time DEFAULTS.
---
WHATS_NEW | 1 +
lib/cache_segtype/cache.c | 5 +++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 92b62a6..2a58a8b 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.116 -
====================================
+ Set default cache_mode when unset/missing in metadata.
Preserve chunk size with repair and metadata swap of a thin pool.
Fix raid --splitmirror 1 functionality (2.02.112).
Fix tree preload to handle splitting raid images.
diff --git a/lib/cache_segtype/cache.c b/lib/cache_segtype/cache.c
index 73839f4..0cab85a 100644
--- a/lib/cache_segtype/cache.c
+++ b/lib/cache_segtype/cache.c
@@ -68,7 +68,8 @@ static int _cache_pool_text_import(struct lv_segment *seg,
return SEG_LOG_ERROR("cache_mode must be a string in");
if (!set_cache_pool_feature(&seg->feature_flags, str))
return SEG_LOG_ERROR("Unknown cache_mode in");
- }
+ } else if (!set_cache_pool_feature(&seg->feature_flags, DEFAULT_CACHE_POOL_CACHEMODE))
+ return SEG_LOG_ERROR(INTERNAL_ERROR "Unknown built-in cache_mode");
if (dm_config_has_node(sn, "policy")) {
if (!(str = dm_config_find_str(sn, "policy", NULL)))
@@ -77,7 +78,7 @@ static int _cache_pool_text_import(struct lv_segment *seg,
return SEG_LOG_ERROR("Failed to duplicate policy in");
} else
/* Cannot use 'just' default, so pick one */
- seg->policy_name = DEFAULT_CACHE_POOL_POLICY; /* FIXME make configurable */
+ seg->policy_name = DEFAULT_CACHE_POOL_CACHEMODE; /* FIXME make configurable */
/*
* Read in policy args:
9 years, 3 months
master - raid: preload splitted LV only when active
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=bfeabea631782b...
Commit: bfeabea631782b3f0b8ec6494c4490663c412774
Parent: c3bb6d77dd6193755070c62c6f3adb93c1976f19
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Jan 28 18:30:08 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Jan 28 18:30:08 2015 +0100
raid: preload splitted LV only when active
Check splitted leg is active before preload.
(Since splitmirrors currently only does work active raid volumes
it's not a change for current code flow).
Minor optimization included - when already positively checked
for raid image don't check again for raid metadata.
---
lib/activate/activate.c | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/lib/activate/activate.c b/lib/activate/activate.c
index 00d3a10..fc9bc4b 100644
--- a/lib/activate/activate.c
+++ b/lib/activate/activate.c
@@ -1760,18 +1760,15 @@ static int _preload_detached_lv(struct logical_volume *lv, void *data)
struct detached_lv_data *detached = data;
struct lv_list *lvl_pre;
- /* Check and preload removed raid image leg */
+ /* Check and preload removed raid image leg or metadata */
if (lv_is_raid_image(lv)) {
if ((lvl_pre = find_lv_in_vg_by_lvid(detached->lv_pre->vg, &lv->lvid)) &&
- !lv_is_raid_image(lvl_pre->lv) &&
+ !lv_is_raid_image(lvl_pre->lv) && lv_is_active(lv) &&
!_lv_preload(lvl_pre->lv, detached->laopts, detached->flush_required))
return_0;
- }
-
- /* Check and preload removed of raid metadata */
- if (lv_is_raid_metadata(lv)) {
+ } else if (lv_is_raid_metadata(lv)) {
if ((lvl_pre = find_lv_in_vg_by_lvid(detached->lv_pre->vg, &lv->lvid)) &&
- !lv_is_raid_metadata(lvl_pre->lv) &&
+ !lv_is_raid_metadata(lvl_pre->lv) && lv_is_active(lv) &&
!_lv_preload(lvl_pre->lv, detached->laopts, detached->flush_required))
return_0;
}
9 years, 3 months