From 9e9163618ab36a6b046b6380d6ef58429b219ef8 Mon Sep 17 00:00:00 2001 From: Heinz Mauelshagen Date: Mon, 19 Jun 2017 22:25:54 +0200 Subject: [PATCH] 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 file changed, 13 insertions(+) diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c index 95ce3b592..8fc04fb4e 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)) { -- 2.43.5