[lvm-devel] master - lvconvert: disable reshaping of open RAID LV
Heinz Mauelshagen
heinzm at sourceware.org
Mon Jun 19 20:30:51 UTC 2017
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=9e9163618ab36a6b046b6380d6ef58429b219ef8
Commit: 9e9163618ab36a6b046b6380d6ef58429b219ef8
Parent: e1a1c20e95974811ffa541f02723a9390132d10b
Author: Heinz Mauelshagen <heinzm at redhat.com>
AuthorDate: Mon Jun 19 22:25:54 2017 +0200
Committer: Heinz Mauelshagen <heinzm at 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)) {
More information about the lvm-devel
mailing list