master - tests: test also different lock holder
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=710f51e7f24bfc6c4e4...
Commit: 710f51e7f24bfc6c4e4300e4bec3316796bf0c78
Parent: 3d591ac376b369de78d8471c2651256c5eb52b1f
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Jun 20 18:22:17 2017 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Jun 20 18:25:10 2017 +0200
tests: test also different lock holder
---
test/shell/lvconvert-raid-takeover-thin.sh | 26 +++++++++++++++++++++++---
1 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/test/shell/lvconvert-raid-takeover-thin.sh b/test/shell/lvconvert-raid-takeover-thin.sh
index 93d887d..647b133 100644
--- a/test/shell/lvconvert-raid-takeover-thin.sh
+++ b/test/shell/lvconvert-raid-takeover-thin.sh
@@ -22,10 +22,10 @@ aux have_raid 1 9 0 || skip
aux prepare_vg 6
-lvcreate -L4 -i3 -T $vg/pool -V10
+lvcreate -L4 -i3 -T $vg/pool -V10
for i in 1 2 ; do
-lvconvert --type raid10 -y $vg/pool_tdata
+lvconvert --type raid10 -y $vg/pool_tdata
check grep_dmsetup table $vg-pool_tdata "raid10"
aux wait_for_sync $vg pool_tdata
@@ -35,7 +35,27 @@ done
lvremove -f $vg
-lvcreate -L4 -T $vg/pool -V10
+lvcreate -L4 -T $vg/pool -V10 -n $lv1
+
+for j in data meta ; do
+ LV=pool_t${j}
+ for i in 1 2 ; do
+ lvconvert --type raid1 -m1 -y $vg/$LV
+ check grep_dmsetup table $vg-${LV} "raid1"
+ aux wait_for_sync $vg $LV
+
+ lvconvert --type raid1 -m0 -y $vg/$LV
+ check grep_dmsetup table ${vg}-${LV} "linear"
+ done
+done
+
+
+#
+# Now same test again, when lock holding LV is not a thin-poll
+# but thinLV $lv1
+#
+lvchange -an $vg
+lvchange -ay $vg/$lv1
for j in data meta ; do
LV=pool_t${j}
6 years, 10 months
master - tests: avoid double lines
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=3d591ac376b369de78d...
Commit: 3d591ac376b369de78d8471c2651256c5eb52b1f
Parent: 1ea41b6d486cc34bf55e51eaac60f2cadfc866c3
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Jun 20 17:15:07 2017 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Jun 20 18:24:52 2017 +0200
tests: avoid double lines
Skip showing same line twice in test's verbose log.
---
test/lib/check.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/lib/check.sh b/test/lib/check.sh
index 64812fb..5eec936 100644
--- a/test/lib/check.sh
+++ b/test/lib/check.sh
@@ -411,7 +411,7 @@ raid_leg_status() {
grep_dmsetup() {
dmsetup $1 $2 | tee out
- grep "${@:3}" out || die "Expected output from dmsetup $1 not found!"
+ grep -q "${@:3}" out || die "Expected output \"${@:3}\" from dmsetup $1 not found!"
}
#set -x
6 years, 10 months
master - activation: fix usage of origin_only
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=1ea41b6d486cc34bf55...
Commit: 1ea41b6d486cc34bf55e51eaac60f2cadfc866c3
Parent: 5e611c700ba1032ffb71bf0cdd33e062e5e16439
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Jun 20 17:11:42 2017 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Jun 20 18:23:24 2017 +0200
activation: fix usage of origin_only
When lock-holding LV differs from actually request locked LV,
we drop origin_only flag as it has no use - it'd be applied
on completely different LV.
Example of problem:
Raid is thin-pool _tdata LV.
Raid run origin_only locking on stacked device.
As lock holder is discovered thinLV.
Whole origin_only operation is then applied only on thinLV
changing the meaning of whole operation.
NOTE: this patch does not change anything for LV that are
already top-level lock holding LVs (i.e. thinLVs, snahoshots/origins).
---
lib/metadata/lv_manip.c | 6 ++++++
lib/metadata/raid_manip.c | 15 +++++++++++++--
2 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 8f38839..9e98ee3 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -6368,6 +6368,12 @@ static int _lv_update_and_reload(struct logical_volume *lv, int origin_only)
if (!vg_write(vg))
return_0;
+ if (lock_lv != lv) {
+ log_debug_activation("Dropping origin_only for %s as lock holds %s",
+ display_lvname(lv), display_lvname(lock_lv));
+ origin_only = 0;
+ }
+
if (!(origin_only ? suspend_lv_origin(vg->cmd, lock_lv) : suspend_lv(vg->cmd, lock_lv))) {
log_error("Failed to lock logical volume %s.",
display_lvname(lock_lv));
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index 93895fe..6d3a509 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -551,10 +551,21 @@ static int _lv_update_reload_fns_reset_eliminate_lvs(struct logical_volume *lv,
fn_on_lv_t fn_pre_on_lv = NULL, fn_post_on_lv;
void *fn_pre_data, *fn_post_data = NULL;
struct dm_list *removal_lvs;
+ const struct logical_volume *lock_lv = lv_lock_holder(lv);
va_start(ap, origin_only);
removal_lvs = va_arg(ap, struct dm_list *);
+ if (lock_lv != lv) {
+ log_debug_activation("Dropping origin_only for %s as lock holds %s",
+ display_lvname(lv), display_lvname(lock_lv));
+ origin_only = 0;
+ }
+ origin_only = 0;
+
+ /* TODO/FIXME: this function should be simplified to just call
+ * lv_update_and_reload() and cleanup of remained LVs */
+
/* Retrieve post/pre functions and post/pre data reference from variable arguments, if any */
if ((fn_post_on_lv = va_arg(ap, fn_on_lv_t))) {
fn_post_data = va_arg(ap, void *);
@@ -576,8 +587,8 @@ static int _lv_update_reload_fns_reset_eliminate_lvs(struct logical_volume *lv,
* Returning 2 from pre function -> lv is suspended and
* metadata got updated, don't need to do it again
*/
- if (!(r = (origin_only ? resume_lv_origin(lv->vg->cmd, lv_lock_holder(lv)) :
- resume_lv(lv->vg->cmd, lv_lock_holder(lv))))) {
+ if (!(r = (origin_only ? resume_lv_origin(lv->vg->cmd, lock_lv) :
+ resume_lv(lv->vg->cmd, lock_lv)))) {
log_error("Failed to resume %s.", display_lvname(lv));
return 0;
}
6 years, 10 months
master - lvconvert: check open count to disable reshaping of open RAID LV
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=5e611c700ba1032ffb7...
Commit: 5e611c700ba1032ffb71bf0cdd33e062e5e16439
Parent: 601ad1c73faa5fe3d74ff5b06cc47073b40a1850
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Tue Jun 20 17:59:10 2017 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Tue Jun 20 17:59:10 2017 +0200
lvconvert: check open count to disable reshaping of open RAID LV
Also check LV open count in addition to opening the RaidLV
exclusively as of commit 601ad1c73faa5fe3d74ff5b06cc47073b40a1850.
Related: rhbz1447812
---
lib/metadata/raid_manip.c | 27 +++++++++++++++++++++++++++
1 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index f787ad0..93895fe 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -75,6 +75,23 @@ static int _rebuild_with_emptymeta_is_supported(struct cmd_context *cmd,
return 1;
}
+/* BZ1447812: check open count of @lv vs. @open_count */
+static int _check_lv_open_count(struct logical_volume *lv, int open_count) {
+ struct lvinfo info = { 0 };
+
+ if (!lv_info(lv->vg->cmd, lv, 0, &info, 1, 0)) {
+ log_error("lv_info failed: aborting.");
+ return 0;
+ }
+ if (info.open_count != open_count) {
+ log_error("Reshape of open %s not supported.", display_lvname(lv));
+ return 0;
+ }
+
+ return 1;
+}
+
+
/*
* Ensure region size exceeds the minimum for @lv because
* MD's bitmap is limited to tracking 2^21 regions.
@@ -2371,6 +2388,10 @@ static int _raid_reshape(struct logical_volume *lv,
seg->region_size = new_region_size;
+ /* BZ1447812: also check open count */
+ if (!_check_lv_open_count(lv, 1))
+ return 0;
+
if (seg->area_count != 2 || old_image_count != seg->area_count) {
if (!_lv_update_reload_fns_reset_eliminate_lvs(lv, 0, &removal_lvs,
_post_raid_reshape, NULL,
@@ -6351,8 +6372,14 @@ int lv_raid_convert(struct logical_volume *lv,
}
/* BZ1447812: reject reshape on open LV */
+ if (!_check_lv_open_count(lv, 0))
+ return 0;
if (!_lv_open_excl(lv, &dev))
return 0;
+ if (!_check_lv_open_count(lv, 1)) {
+ dev_close(dev);
+ return 0;
+ }
if (!_raid_reshape(lv, new_segtype, yes, force,
data_copies, region_size,
6 years, 10 months
master - lvconvert: enhance disable reshaping of open RAID LV
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=601ad1c73faa5fe3d74...
Commit: 601ad1c73faa5fe3d74ff5b06cc47073b40a1850
Parent: 31cd01c9b31c2c4e63797edd673fca8dc53da022
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Tue Jun 20 17:27:58 2017 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Tue Jun 20 17:27:58 2017 +0200
lvconvert: enhance disable reshaping of open RAID LV
Enhance commit 9e9163618ab36a6b046b6380d6ef58429b219ef8
to use dev_open_flags/dev_close API.
Related: rhbz1447812
---
lib/metadata/raid_manip.c | 36 +++++++++++++++++++++++++-----------
1 files changed, 25 insertions(+), 11 deletions(-)
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index 56cc592..f787ad0 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -6210,6 +6210,26 @@ static int _conversion_options_allowed(const struct lv_segment *seg_from,
return r;
}
+/* BZ1447812: try opening LV exclusively */
+static int _lv_open_excl(struct logical_volume *lv, struct device **dev) {
+ char *dev_path;
+ size_t sz = strlen(lv->vg->cmd->dev_dir) + strlen(lv->vg->name) + strlen(lv->name) + 2;
+
+ *dev = NULL;
+ if (!(dev_path = dm_pool_alloc(lv->vg->cmd->mem, sz)))
+ return_0;
+ if (dm_snprintf(dev_path, sz, "%s%s/%s", lv->vg->cmd->dev_dir, lv->vg->name, lv->name) < 0)
+ return_0;
+ if (!(*dev = dev_create_file(dev_path, NULL, NULL, 0)))
+ return_0;
+ if (!dev_open_flags(*dev, O_EXCL, 1, 1)) {
+ log_error("Reshape of open %s not supported.", display_lvname(lv));
+ return 0;
+ }
+
+ return 1;
+}
+
/*
* lv_raid_convert
*
@@ -6259,8 +6279,7 @@ int lv_raid_convert(struct logical_volume *lv,
uint32_t region_size;
uint32_t data_copies = seg->data_copies;
uint32_t available_slvs, removed_slvs;
- char *dev_path;
- size_t sz;
+ struct device *dev;
takeover_fn_t takeover_fn;
/* FIXME If not active, prompt and activate */
@@ -6331,24 +6350,19 @@ int lv_raid_convert(struct logical_volume *lv,
return 0;
}
- /* BZ1447812 */
- sz = strlen(lv->vg->cmd->dev_dir) + strlen(lv->vg->name) + strlen(lv->name) + 2;
- if (!(dev_path = dm_pool_alloc(lv->vg->cmd->mem, sz)))
- return_0;
- if (dm_snprintf(dev_path, sz, "%s%s/%s", lv->vg->cmd->dev_dir, lv->vg->name, lv->name) < 0)
- return_0;
- if (open(dev_path, O_RDONLY|O_EXCL) && errno) {
- log_error("Reshape of open %s not supported.", display_lvname(lv));
+ /* BZ1447812: reject reshape on open LV */
+ if (!_lv_open_excl(lv, &dev))
return 0;
- }
if (!_raid_reshape(lv, new_segtype, yes, force,
data_copies, region_size,
stripes, stripe_size, allocate_pvs)) {
+ dev_close(dev);
log_error("Reshape request failed on LV %s.", display_lvname(lv));
return 0;
}
+ dev_close(dev);
return 1;
case 2:
log_error("Invalid conversion request on %s.", display_lvname(lv));
6 years, 10 months
master - tests: check conversion of thin-pool
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=31cd01c9b31c2c4e637...
Commit: 31cd01c9b31c2c4e63797edd673fca8dc53da022
Parent: 19cc03fa5275fa6d00a1f726bae40141559e2913
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jun 19 23:15:46 2017 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jun 19 23:30:11 2017 +0200
tests: check conversion of thin-pool
---
test/shell/lvconvert-raid-takeover-thin.sh | 52 ++++++++++++++++++++++++++++
1 files changed, 52 insertions(+), 0 deletions(-)
diff --git a/test/shell/lvconvert-raid-takeover-thin.sh b/test/shell/lvconvert-raid-takeover-thin.sh
new file mode 100644
index 0000000..93d887d
--- /dev/null
+++ b/test/shell/lvconvert-raid-takeover-thin.sh
@@ -0,0 +1,52 @@
+#!/bin/sh
+# Copyright (C) 2017 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
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA2110-1301 USA
+
+# check we may convert thin-pool to raid1/raid10 and back
+# RHBZ#1365286
+
+SKIP_WITH_LVMLOCKD=1
+SKIP_WITH_LVMPOLLD=1
+
+. lib/inittest
+
+aux have_thin 1 0 0 || skip
+aux have_raid 1 9 0 || skip
+
+aux prepare_vg 6
+
+lvcreate -L4 -i3 -T $vg/pool -V10
+
+for i in 1 2 ; do
+lvconvert --type raid10 -y $vg/pool_tdata
+check grep_dmsetup table $vg-pool_tdata "raid10"
+aux wait_for_sync $vg pool_tdata
+
+lvconvert --type striped -y $vg/pool_tdata
+check grep_dmsetup table $vg-pool_tdata "striped"
+done
+
+lvremove -f $vg
+
+lvcreate -L4 -T $vg/pool -V10
+
+for j in data meta ; do
+ LV=pool_t${j}
+ for i in 1 2 ; do
+ lvconvert --type raid1 -m1 -y $vg/$LV
+ check grep_dmsetup table $vg-${LV} "raid1"
+ aux wait_for_sync $vg $LV
+
+ lvconvert --type raid1 -m0 -y $vg/$LV
+ check grep_dmsetup table ${vg}-${LV} "linear"
+ done
+done
+
+vgremove -ff $vg
6 years, 10 months
master - thin: restore conversion to raid
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=19cc03fa5275fa6d00a...
Commit: 19cc03fa5275fa6d00a1f726bae40141559e2913
Parent: 9e9163618ab36a6b046b6380d6ef58429b219ef8
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jun 19 23:11:11 2017 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jun 19 23:30:08 2017 +0200
thin: restore conversion to raid
Since commit 1bc546269a7d2cae156827e282715410a4967d51 we've disabled
coversion of raid. This however already got fixed, so reenable
commands like: 'lvconvert --type raid1 vg/pool_tdata'.
---
WHATS_NEW | 1 +
lib/metadata/raid_manip.c | 21 ++++++---------------
2 files changed, 7 insertions(+), 15 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 305e185..e60380a 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.172 -
===============================
+ Reenable conversion of data and metadata thin-pool volumes to raid.
Improve raid status reporting with lvs.
No longer necessary to '--force' a repair for RAID1
Linear to RAID1 upconverts now use "recover" sync action, not "resync".
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index 8fc04fb..56cc592 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -2552,14 +2552,6 @@ static int _raid_add_images_without_commit(struct logical_volume *lv,
return 0;
}
- if (lv_is_active(lv_lock_holder(lv)) &&
- (old_count == 1) &&
- (lv_is_thin_pool_data(lv) || lv_is_thin_pool_metadata(lv))) {
- log_error("Can't add image to active thin pool LV %s yet. Deactivate first.",
- display_lvname(lv));
- return 0;
- }
-
if (!archive(lv->vg))
return_0;
@@ -6278,6 +6270,12 @@ int lv_raid_convert(struct logical_volume *lv,
log_error("%s must be active to perform this operation.",
display_lvname(lv));
return 0;
+ } else if (vg_is_clustered(lv->vg) &&
+ !lv_is_active_exclusive_locally(lv_lock_holder(lv))) {
+ /* In clustered VGs, the LV must be active on this node exclusively. */
+ log_error("%s must be active exclusive locally to "
+ "perform this operation.", display_lvname(lv));
+ return 0;
}
new_segtype = new_segtype ? : seg->segtype;
@@ -6406,13 +6404,6 @@ int lv_raid_convert(struct logical_volume *lv,
(segtype_is_striped_target(new_segtype) &&
(new_stripes == 1)) ? SEG_TYPE_NAME_LINEAR : new_segtype->name);
- /* In clustered VGs, the LV must be active on this node exclusively. */
- if (vg_is_clustered(lv->vg) && !lv_is_active_exclusive_locally(lv)) {
- log_error("%s must be active exclusive locally to "
- "perform this operation.", display_lvname(lv));
- return 0;
- }
-
/* LV must be in sync. */
if (!_raid_in_sync(lv)) {
log_error("Unable to convert %s while it is not in-sync.",
6 years, 10 months
master - lvconvert: disable reshaping of open RAID LV
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=9e9163618ab36a6b046...
Commit: 9e9163618ab36a6b046b6380d6ef58429b219ef8
Parent: e1a1c20e95974811ffa541f02723a9390132d10b
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Mon Jun 19 22:25:54 2017 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Mon Jun 19 22:25:54 2017 +0200
lvconvert: disable reshaping of open RAID LV
Disable until we have a proper fix for reshape space allocation,
switching it to begin/end of rimages and activation.
Related: rhbz1447812
---
lib/metadata/raid_manip.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index 95ce3b5..8fc04fb 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -6267,6 +6267,8 @@ int lv_raid_convert(struct logical_volume *lv,
uint32_t region_size;
uint32_t data_copies = seg->data_copies;
uint32_t available_slvs, removed_slvs;
+ char *dev_path;
+ size_t sz;
takeover_fn_t takeover_fn;
/* FIXME If not active, prompt and activate */
@@ -6331,6 +6333,17 @@ int lv_raid_convert(struct logical_volume *lv,
return 0;
}
+ /* BZ1447812 */
+ sz = strlen(lv->vg->cmd->dev_dir) + strlen(lv->vg->name) + strlen(lv->name) + 2;
+ if (!(dev_path = dm_pool_alloc(lv->vg->cmd->mem, sz)))
+ return_0;
+ if (dm_snprintf(dev_path, sz, "%s%s/%s", lv->vg->cmd->dev_dir, lv->vg->name, lv->name) < 0)
+ return_0;
+ if (open(dev_path, O_RDONLY|O_EXCL) && errno) {
+ log_error("Reshape of open %s not supported.", display_lvname(lv));
+ return 0;
+ }
+
if (!_raid_reshape(lv, new_segtype, yes, force,
data_copies, region_size,
stripes, stripe_size, allocate_pvs)) {
6 years, 10 months
master - lvconvert: enhance message
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=e1a1c20e95974811ffa...
Commit: e1a1c20e95974811ffa541f02723a9390132d10b
Parent: f342e803ba3c32890a2b08736fa94bdd541d5e9c
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Mon Jun 19 21:40:38 2017 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Mon Jun 19 21:40:38 2017 +0200
lvconvert: enhance message
Enhance message introduced by last
commit f342e803ba3c32890a2b08736fa94bdd541d5e9c.
Related: rhbz1439399
---
lib/metadata/raid_manip.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index 0a08ca9..95ce3b5 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -6314,7 +6314,7 @@ int lv_raid_convert(struct logical_volume *lv,
/* BZ1439399 */
if (lv_is_origin(lv)) {
- log_error("Can't convert %s under snapshot.", display_lvname(lv));
+ log_error("Can't convert snapshot origin %s.", display_lvname(lv));
return 0;
}
6 years, 10 months
master - lvconvert: disable conversion of RAID LV under snapshot
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=f342e803ba3c32890a2...
Commit: f342e803ba3c32890a2b08736fa94bdd541d5e9c
Parent: fb46175ce7550fd6c9f40e6d8eec337fc2693e80
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Mon Jun 19 21:08:52 2017 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Mon Jun 19 21:08:52 2017 +0200
lvconvert: disable conversion of RAID LV under snapshot
Disable until we have a proper fix for reshape space allocation,
switching it to begin/end of rimages and activation.
Related: rhbz1439399
---
lib/metadata/raid_manip.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index 6abf482..0a08ca9 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -6312,6 +6312,12 @@ int lv_raid_convert(struct logical_volume *lv,
new_stripes, new_stripe_size_supplied))
return _log_possible_conversion_types(lv, new_segtype);
+ /* BZ1439399 */
+ if (lv_is_origin(lv)) {
+ log_error("Can't convert %s under snapshot.", display_lvname(lv));
+ return 0;
+ }
+
/*
* reshape of capable raid type requested
*/
6 years, 10 months