master - lvconvert: fix inactive mirror up converting regression
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=aa1d5d5c89873c00026...
Commit: aa1d5d5c89873c0002628142fd9b2c7c4cc1da55
Parent: 8333d5a969042a321f00656271bd55a37c1ea179
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Mon Apr 24 17:44:54 2017 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Mon Apr 24 17:44:54 2017 +0200
lvconvert: fix inactive mirror up converting regression
Up converting an inactive mirror with insufficient
devs results in an over concerned warning.
Resolves: rhbz1437653
---
tools/lvconvert.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index d5ca6d7..22967e8 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -919,7 +919,7 @@ static int _lvconvert_mirrors_aux(struct cmd_context *cmd,
MIRROR_BY_LV)) {
layer_lv = seg_lv(first_seg(lv), 0);
if (!remove_layer_from_lv(lv, layer_lv) ||
- !deactivate_lv(cmd, layer_lv) ||
+ (lv_is_active(lv) && !deactivate_lv(cmd, layer_lv)) ||
!lv_remove(layer_lv) ||
!vg_write(lv->vg) || !vg_commit(lv->vg)) {
log_error("ABORTING: Failed to remove "
6 years, 12 months
master - raid: handle insufficent PVs on takeover to/from raid4
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=8f305f025ed862689a8...
Commit: 8f305f025ed862689a8b4e34557e6a469201cba0
Parent: 97a5fa4b876ea861a5927ff714b617bb4c72efbc
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Sat Apr 22 01:19:44 2017 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Sat Apr 22 01:19:44 2017 +0200
raid: handle insufficent PVs on takeover to/from raid4
Commit 7bc85177b08c7a6f4f0c3384c8d05b9089267c14
felt short relative to striped/raid0* -> raid4
and raid4 -> raid6.
Related: rhbz1438013
---
lib/metadata/raid_manip.c | 150 +++++++++++++++++++++++++++++++++------------
1 files changed, 110 insertions(+), 40 deletions(-)
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index 1563110..b708442 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -138,6 +138,18 @@ static void _check_and_adjust_region_size(const struct logical_volume *lv)
seg->region_size = raid_ensure_min_region_size(lv, lv->size, seg->region_size);
}
+/* Drop @suffix from *str by writing '\0' to the beginning of @suffix */
+static int _drop_suffix(const char *str, const char *suffix)
+{
+ char *p;
+
+ if (!(p = strstr(str, suffix)))
+ return_0;
+
+ *p = '\0';
+ return 1;
+}
+
/* Strip any raid suffix off LV name */
char *top_level_lv_name(struct volume_group *vg, const char *lv_name)
{
@@ -3386,6 +3398,27 @@ static int _alloc_rmeta_devs_for_rimage_devs(struct logical_volume *lv,
return 1;
}
+/* Add new @lv to @seg at area index @idx */
+static int _add_component_lv(struct lv_segment *seg, struct logical_volume *lv, uint64_t lv_flags, uint32_t idx)
+{
+ if (lv_flags & VISIBLE_LV)
+ lv_set_visible(lv);
+ else
+ lv_set_hidden(lv);
+
+ if (lv_flags & LV_REBUILD)
+ lv->status |= LV_REBUILD;
+ else
+ lv->status &= ~LV_REBUILD;
+
+ if (!set_lv_segment_area_lv(seg, idx, lv, 0 /* le */, lv->status)) {
+ log_error("Failed to add sublv %s.", display_lvname(lv));
+ return 0;
+ }
+
+ return 1;
+}
+
/* Add new @lvs to @lv at @area_offset */
static int _add_image_component_list(struct lv_segment *seg, int delete_from_list,
uint64_t lv_flags, struct dm_list *lvs, uint32_t area_offset)
@@ -3396,22 +3429,8 @@ static int _add_image_component_list(struct lv_segment *seg, int delete_from_lis
dm_list_iterate_items_safe(lvl, tmp, lvs) {
if (delete_from_list)
dm_list_del(&lvl->list);
-
- if (lv_flags & VISIBLE_LV)
- lv_set_visible(lvl->lv);
- else
- lv_set_hidden(lvl->lv);
-
- if (lv_flags & LV_REBUILD)
- lvl->lv->status |= LV_REBUILD;
- else
- lvl->lv->status &= ~LV_REBUILD;
-
- if (!set_lv_segment_area_lv(seg, s++, lvl->lv, 0 /* le */, lvl->lv->status)) {
- log_error("Failed to add sublv %s.",
- display_lvname(lvl->lv));
+ if (!_add_component_lv(seg, lvl->lv, lv_flags, s++))
return 0;
- }
}
return 1;
@@ -5026,12 +5045,30 @@ static int _striped_to_raid0_wrapper(struct logical_volume *lv,
return 1;
}
+/* Set sizes of @lv on takeover upconvert */
+static void _set_takeover_upconvert_sizes(struct logical_volume *lv,
+ const struct segment_type *new_segtype,
+ uint32_t region_size, uint32_t stripe_size,
+ uint32_t extents_copied, uint32_t seg_len) {
+ struct lv_segment *seg = first_seg(lv);
+
+ seg->segtype = new_segtype;
+ seg->region_size = region_size;
+ seg->stripe_size = stripe_size;
+ seg->extents_copied = extents_copied;
+
+ /* FIXME Hard-coded to raid4/5/6/10 */
+ lv->le_count = seg->len = seg->area_len = seg_len;
+
+ _check_and_adjust_region_size(lv);
+}
+
/* Helper: striped/raid0/raid0_meta/raid1 -> raid4/5/6/10, raid45 -> raid6 wrapper */
static int _takeover_upconvert_wrapper(TAKEOVER_FN_ARGS)
{
uint32_t extents_copied, region_size, seg_len, stripe_size;
struct lv_segment *seg = first_seg(lv);
- const struct segment_type *initial_segtype = seg->segtype;
+ const struct segment_type *raid5_n_segtype, *initial_segtype = seg->segtype;
struct dm_list removal_lvs;
dm_list_init(&removal_lvs);
@@ -5077,11 +5114,9 @@ static int _takeover_upconvert_wrapper(TAKEOVER_FN_ARGS)
}
if (!new_stripe_size)
- new_stripe_size = 128;
+ new_stripe_size = 2 * DEFAULT_STRIPESIZE;
}
- region_size = seg->region_size;
-
if (!_check_region_size_constraints(lv, new_segtype, new_region_size, new_stripe_size))
return 0;
@@ -5100,23 +5135,25 @@ static int _takeover_upconvert_wrapper(TAKEOVER_FN_ARGS)
return_0;
}
- /* Add metadata LVs */
+ /* Add metadata LVs in case of raid0 */
if (seg_is_raid0(seg)) {
log_debug_metadata("Adding metadata LVs to %s.", display_lvname(lv));
if (!_raid0_add_or_remove_metadata_lvs(lv, 0 /* update_and_reload */, allocate_pvs, NULL))
return 0;
- /* raid0_meta -> raid4 needs clearing of MetaLVs in order to avoid raid disk role change issues in the kernel */
}
+ /* Have to be cleared in conversion from raid0_meta -> raid4 or kernel will reject due to reordering disks */
if (segtype_is_raid0_meta(initial_segtype) &&
segtype_is_raid4(new_segtype) &&
!_clear_meta_lvs(lv))
return_0;
+ region_size = new_region_size ?: seg->region_size;
+ stripe_size = new_stripe_size ?: seg->stripe_size;
extents_copied = seg->extents_copied;
seg_len = seg->len;
- stripe_size = seg->stripe_size;
+ /* In case of raid4/5, adjust to allow for allocation of additonal image pairs */
if (seg_is_raid4(seg) || seg_is_any_raid5(seg)) {
if (!(seg->segtype = get_segtype_from_flag(lv->vg->cmd, SEG_RAID0_META)))
return_0;
@@ -5140,7 +5177,8 @@ static int _takeover_upconvert_wrapper(TAKEOVER_FN_ARGS)
*
* - initial type is raid0 -> just remove remove metadata devices
*
- * - initial type is striped -> convert back to it (removes metadata devices)
+ * - initial type is striped -> convert back to it
+ * (removes metadata and image devices)
*/
if (segtype_is_raid0(initial_segtype) &&
!_raid0_add_or_remove_metadata_lvs(lv, 0, NULL, &removal_lvs))
@@ -5157,6 +5195,52 @@ static int _takeover_upconvert_wrapper(TAKEOVER_FN_ARGS)
seg = first_seg(lv);
}
+ /* Process raid4 (up)converts */
+ if (segtype_is_raid4(initial_segtype)) {
+ if (!(raid5_n_segtype = get_segtype_from_flag(lv->vg->cmd, SEG_RAID5_N)))
+ return_0;
+
+ /* raid6 upconvert: vonvert to raid5_n preserving already allocated new image component pair */
+ if (segtype_is_any_raid6(new_segtype)) {
+ struct logical_volume *meta_lv, *data_lv;
+
+ if (new_image_count != seg->area_count)
+ return_0;
+
+ log_debug_metadata ("Extracting last image component pair of %s temporarily.",
+ display_lvname(lv));
+ if (!_extract_image_components(seg, seg->area_count - 1, &meta_lv, &data_lv))
+ return_0;
+
+ _set_takeover_upconvert_sizes(lv, initial_segtype,
+ region_size, stripe_size,
+ extents_copied, seg_len);
+ seg->area_count--;
+
+ if (!_raid45_to_raid54_wrapper(lv, raid5_n_segtype, yes, force, seg->area_count,
+ 1 /* data_copies */, 0, 0, 0, allocate_pvs))
+ return 0;
+
+ if (!_drop_suffix(meta_lv->name, "_extracted") ||
+ !_drop_suffix(data_lv->name, "_extracted"))
+ return 0;
+
+ data_lv->status |= RAID_IMAGE;
+ meta_lv->status |= RAID_META;
+ seg->area_count++;
+
+ log_debug_metadata ("Adding extracted last image component pair back to %s to convert to %s.",
+ display_lvname(lv), new_segtype->name);
+ if (!_add_component_lv(seg, meta_lv, LV_REBUILD, seg->area_count - 1) ||
+ !_add_component_lv(seg, data_lv, LV_REBUILD, seg->area_count - 1))
+ return_0;
+
+ } else if (segtype_is_raid5_n(new_segtype) &&
+ !_raid45_to_raid54_wrapper(lv, raid5_n_segtype, yes, force, seg->area_count,
+ 1 /* data_copies */, 0, 0, 0, allocate_pvs))
+ return 0;
+ }
+
seg->data_copies = new_data_copies;
if (segtype_is_raid4(new_segtype) &&
@@ -5181,15 +5265,9 @@ static int _takeover_upconvert_wrapper(TAKEOVER_FN_ARGS)
}
- seg->segtype = new_segtype;
- seg->region_size = new_region_size ?: region_size;
- seg->stripe_size = new_stripe_size ?: stripe_size;
- seg->extents_copied = extents_copied;
-
- /* FIXME Hard-coded to raid4/5/6/10 */
- lv->le_count = seg->len = seg->area_len = seg_len;
-
- _check_and_adjust_region_size(lv);
+ _set_takeover_upconvert_sizes(lv, new_segtype,
+ region_size, stripe_size,
+ extents_copied, seg_len);
log_debug_metadata("Updating VG metadata and reloading %s LV %s.",
lvseg_name(seg), display_lvname(lv));
@@ -5455,14 +5533,6 @@ static int _takeover_from_raid45_to_raid54(TAKEOVER_FN_ARGS)
static int _takeover_from_raid45_to_raid6(TAKEOVER_FN_ARGS)
{
- if (seg_is_raid4(first_seg(lv))) {
- struct segment_type *segtype = get_segtype_from_flag(lv->vg->cmd, SEG_RAID5_N);
-
- if (!segtype ||
- !_raid45_to_raid54_wrapper(lv, segtype, yes, force, first_seg(lv)->area_count,
- 1 /* data_copies */, 0, 0, 0, allocate_pvs))
- return 0;
- }
return _takeover_upconvert_wrapper(lv, new_segtype, yes, force,
first_seg(lv)->area_count + 1 /* new_image_count */,
3 /* data_copies */, 0, new_stripe_size,
6 years, 12 months
master - raid: avoid superfluous variable
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=97a5fa4b876ea861a59...
Commit: 97a5fa4b876ea861a5927ff714b617bb4c72efbc
Parent: effeb2b93d4840b906b1bfa45d05bea9ff8d11e6
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Sat Apr 22 00:50:36 2017 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Sat Apr 22 00:50:36 2017 +0200
raid: avoid superfluous variable
---
lib/metadata/raid_manip.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index 03e32c6..1563110 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -4808,11 +4808,8 @@ static int _shift_parity_dev(struct lv_segment *seg)
static int _raid45_to_raid54_wrapper(TAKEOVER_FN_ARGS)
{
struct lv_segment *seg = first_seg(lv);
- struct dm_list removal_lvs;
uint32_t region_size = seg->region_size;
- dm_list_init(&removal_lvs);
-
if (!(seg_is_raid4(seg) && segtype_is_raid5_n(new_segtype)) &&
!(seg_is_raid5_n(seg) && segtype_is_raid4(new_segtype))) {
log_error("LV %s has to be of type raid4 or raid5_n to allow for this conversion.",
@@ -4841,6 +4838,7 @@ static int _raid45_to_raid54_wrapper(TAKEOVER_FN_ARGS)
return 0;
}
+ /* Have to clear rmeta LVs or the kernel will reject due to reordering disks */
if (!_clear_meta_lvs(lv))
return_0;
@@ -4853,7 +4851,7 @@ static int _raid45_to_raid54_wrapper(TAKEOVER_FN_ARGS)
seg->region_size = new_region_size ?: region_size;
seg->segtype = new_segtype;
- if (!_lv_update_reload_fns_reset_eliminate_lvs(lv, 0, &removal_lvs, NULL))
+ if (!lv_update_and_reload(lv))
return_0;
init_mirror_in_sync(0);
6 years, 12 months
master - test: add raid4 to upconvert allocation failure tests
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=effeb2b93d4840b906b...
Commit: effeb2b93d4840b906b1bfa45d05bea9ff8d11e6
Parent: 149e4fa04b68da8979936ea3eb5bc68fb27127b2
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Sat Apr 22 00:43:31 2017 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Sat Apr 22 00:43:31 2017 +0200
test: add raid4 to upconvert allocation failure tests
---
.../shell/lvconvert-raid-takeover-alloc-failure.sh | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/test/shell/lvconvert-raid-takeover-alloc-failure.sh b/test/shell/lvconvert-raid-takeover-alloc-failure.sh
index 7cb8378..3870c35 100644
--- a/test/shell/lvconvert-raid-takeover-alloc-failure.sh
+++ b/test/shell/lvconvert-raid-takeover-alloc-failure.sh
@@ -49,6 +49,10 @@ function check_no_sub_lvs
# 6-way striped: neither conversion to raid5 nor raid6 possible
lvcreate --yes --stripes 6 --size 4M --name $lv1 $vg
+not lvconvert --yes --type raid4 $vg/$lv1
+check lv_field $vg/$lv1 segtype "striped"
+check_no_sub_lvs $vg $lv1 0 5
+
not lvconvert --yes --type raid5 $vg/$lv1
check lv_field $vg/$lv1 segtype "striped"
check_no_sub_lvs $vg $lv1 0 5
6 years, 12 months
master - lvconvert: preserve region size on raid1 image count changes
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=8333d5a969042a321f0...
Commit: 8333d5a969042a321f00656271bd55a37c1ea179
Parent: 8f305f025ed862689a8b4e34557e6a469201cba0
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Sat Apr 22 02:04:49 2017 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Sat Apr 22 02:04:49 2017 +0200
lvconvert: preserve region size on raid1 image count changes
Unless a change of the regionsize is requested via "lvconvert -R N ...",
keep the region size when the number of images changes in a raid1 LV.
Resolves: rhbz1443705
---
WHATS_NEW | 2 ++
tools/lvconvert.c | 11 ++++++++---
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 5a13744..efcddd5 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,7 @@
Version 2.02.171 -
==================================
+ lvconvert - preserve region size on raid1 image count changes
+ raid - sanely handle insufficient space on takeover
Fix configure --enable-notify-dbus status message.
Change configure option name prefix from --enable-lockd to --enable-lvmlockd.
lvcreate - raise mirror/raid default regionsize to 2MiB
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 5b9510b..d5ca6d7 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -60,6 +60,7 @@ struct lvconvert_params {
int need_polling;
uint32_t region_size;
+ unsigned region_size_supplied;
uint32_t mirrors;
sign_t mirrors_sign;
@@ -247,10 +248,13 @@ static int _read_params(struct cmd_context *cmd, struct lvconvert_params *lp)
return 0;
}
- if (arg_is_set(cmd, regionsize_ARG))
+ if (arg_is_set(cmd, regionsize_ARG)) {
lp->region_size = arg_uint_value(cmd, regionsize_ARG, 0);
- else
+ lp->region_size_supplied = 1;
+ } else {
lp->region_size = get_default_region_size(cmd);
+ lp->region_size_supplied = 0;
+ }
/* FIXME man page says in one place that --type and --mirrors can't be mixed */
if (lp->mirrors_supplied && !lp->mirrors)
@@ -1359,7 +1363,8 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l
DEFAULT_RAID1_MAX_IMAGES, lp->segtype->name, display_lvname(lv));
return 0;
}
- if (!lv_raid_change_image_count(lv, lp->yes, image_count, lp->region_size, lp->pvh))
+ if (!lv_raid_change_image_count(lv, lp->yes, image_count,
+ lp->region_size_supplied ? lp->region_size : seg->region_size , lp->pvh))
return_0;
log_print_unless_silent("Logical volume %s successfully converted.",
6 years, 12 months
master - test: add upconvert allocation failure tests
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=7c7122a3b1482900f71...
Commit: 7c7122a3b1482900f71168f7ce0fec176eb36f8a
Parent: d48b816764fcf2b153d9d4f27244be5b96846227
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Fri Apr 21 20:57:31 2017 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Fri Apr 21 20:57:31 2017 +0200
test: add upconvert allocation failure tests
---
.../shell/lvconvert-raid-takeover-alloc-failure.sh | 98 ++++++++++++++++++++
1 files changed, 98 insertions(+), 0 deletions(-)
diff --git a/test/shell/lvconvert-raid-takeover-alloc-failure.sh b/test/shell/lvconvert-raid-takeover-alloc-failure.sh
new file mode 100644
index 0000000..7cb8378
--- /dev/null
+++ b/test/shell/lvconvert-raid-takeover-alloc-failure.sh
@@ -0,0 +1,98 @@
+#!/bin/sh
+# Copyright (C) 017 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
+
+SKIP_WITH_LVMLOCKD=1
+SKIP_WITH_LVMPOLLD=1
+
+. lib/inittest
+
+aux have_raid 1 9 1 || skip
+
+aux prepare_vg 6
+
+function check_sub_lvs
+{
+ local vg=$1
+ local lv=$2
+ local end=$3
+
+ for s in `seq 0 $end`
+ do
+ check lv_exists $vg ${lv}_rmeta_$s
+ check lv_exists $vg ${lv}_rimage_$s
+ done
+}
+
+function check_no_sub_lvs
+{
+ local vg=$1
+ local lv=$2
+ local start=$3
+ local end=$4
+
+ for s in `seq $start $end`
+ do
+ check lv_not_exists $vg ${lv}_rmeta_$s
+ check lv_not_exists $vg ${lv}_rimage_$s
+ done
+}
+
+# Check takover upconversion fails allocation errors nicely without leaving image pair remnants behind
+
+# 6-way striped: neither conversion to raid5 nor raid6 possible
+lvcreate --yes --stripes 6 --size 4M --name $lv1 $vg
+not lvconvert --yes --type raid5 $vg/$lv1
+check lv_field $vg/$lv1 segtype "striped"
+check_no_sub_lvs $vg $lv1 0 5
+
+not lvconvert --yes --type raid6 $vg/$lv1
+check lv_field $vg/$lv1 segtype "striped"
+check_no_sub_lvs $vg $lv1 0 5
+
+# raid0_meta conversion is possible
+lvconvert --yes --type raid0_meta $vg/$lv1
+check lv_field $vg/$lv1 segtype "raid0_meta"
+check_sub_lvs $vg $lv1 0 5
+
+lvremove -y $vg
+
+# 5-way striped: conversion to raid5 possible but not to raid6
+lvcreate --yes --stripes 5 --size 4M --name $lv1 $vg
+not lvconvert --yes --type raid6 $vg/$lv1
+check lv_field $vg/$lv1 segtype "striped"
+check_no_sub_lvs $vg $lv1 0 5
+
+lvconvert --yes --type raid5 $vg/$lv1
+check lv_field $vg/$lv1 segtype "raid5_n"
+check lv_field $vg/$lv1 stripes 6
+check lv_field $vg/$lv1 datastripes 5
+check_sub_lvs $vg $lv1 0 5
+
+lvremove -y $vg
+
+# 4-way striped: conversion to raid5 and raid6 possible
+lvcreate --yes --stripes 4 --size 4M --name $lv1 $vg
+lvconvert --yes --type raid5 $vg/$lv1
+check lv_field $vg/$lv1 segtype "raid5_n"
+check lv_field $vg/$lv1 stripes 5
+check lv_field $vg/$lv1 datastripes 4
+check_sub_lvs $vg $lv1 0 4
+check_no_sub_lvs $vg $lv1 5 5
+
+lvremove -y $vg
+lvcreate --yes --stripes 4 --size 4M --name $lv1 $vg
+lvconvert --yes --type raid6 $vg/$lv1
+check lv_field $vg/$lv1 segtype "raid6_n_6"
+check lv_field $vg/$lv1 stripes 6
+check lv_field $vg/$lv1 datastripes 4
+check_sub_lvs $vg $lv1 0 5
+
+vgremove -ff $vg
6 years, 12 months
master - test: consider changed default
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=149e4fa04b68da89799...
Commit: 149e4fa04b68da8979936ea3eb5bc68fb27127b2
Parent: 7c7122a3b1482900f71168f7ce0fec176eb36f8a
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Sat Apr 22 00:42:09 2017 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Sat Apr 22 00:42:09 2017 +0200
test: consider changed default
commit b81b4aad24807d2aa4968aa9fc7d970a65623620
raised the region size so demand the sizes the
test checks for.
---
.../lvconvert-raid-reshape-linear_to_striped.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/shell/lvconvert-raid-reshape-linear_to_striped.sh b/test/shell/lvconvert-raid-reshape-linear_to_striped.sh
index 042cb33..cef35cd 100644
--- a/test/shell/lvconvert-raid-reshape-linear_to_striped.sh
+++ b/test/shell/lvconvert-raid-reshape-linear_to_striped.sh
@@ -45,7 +45,7 @@ aux wait_for_sync $vg $lv1
fsck -fn $DM_DEV_DIR/$vg/$lv1
# Convert raid1 -> raid5_n
-lvconvert -y --ty raid5_n $vg/$lv1
+lvconvert -y --ty raid5_n --stripesize 64K --regionsize 512K $vg/$lv1
fsck -fn $DM_DEV_DIR/$vg/$lv1
check lv_field $vg/$lv1 segtype "raid5_n"
check lv_field $vg/$lv1 stripes 2
6 years, 12 months
master - test: also prevent lvconvert-raid-reshape.sh on single core
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=d48b816764fcf2b153d...
Commit: d48b816764fcf2b153d9d4f27244be5b96846227
Parent: a004cceed2ce050514fe9b4bd66fc948a2b72bc2
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Fri Apr 21 02:17:55 2017 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Fri Apr 21 02:17:55 2017 +0200
test: also prevent lvconvert-raid-reshape.sh on single core
---
test/shell/lvconvert-raid-reshape.sh | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/test/shell/lvconvert-raid-reshape.sh b/test/shell/lvconvert-raid-reshape.sh
index f9ff744..246a3ba 100644
--- a/test/shell/lvconvert-raid-reshape.sh
+++ b/test/shell/lvconvert-raid-reshape.sh
@@ -17,6 +17,10 @@ SKIP_WITH_LVMPOLLD=1
which mkfs.ext4 || skip
aux have_raid 1 10 1 || skip
+# Temporarily skip reshape tests on single-core CPUs until there's a fix for
+# https://bugzilla.redhat.com/1443999 - AGK 2017/04/20
+aux have_multi_core || skip
+
aux prepare_pvs 65 64
vgcreate -s 1M $vg $(cat DEVICES)
7 years
master - test: Adjust previous commit
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a004cceed2ce050514f...
Commit: a004cceed2ce050514fe9b4bd66fc948a2b72bc2
Parent: 18bf954801e0ea3aff4b85e9511b1bbf03a07c2d
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Fri Apr 21 01:21:24 2017 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Fri Apr 21 01:21:24 2017 +0200
test: Adjust previous commit
Change have_single_core to have_multi_core and go back to || logic in related test scripts.
---
test/lib/aux.sh | 4 ++--
.../lvconvert-raid-reshape-linear_to_striped.sh | 3 +--
.../lvconvert-raid-reshape-striped_to_linear.sh | 2 +-
3 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index b05c59d..6217c4c 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -1490,9 +1490,9 @@ have_readline() {
echo version | lvm &>/dev/null
}
-have_single_core() {
+have_multi_core() {
which nproc &>/dev/null || return 0
- [ $(nproc) -eq 1 ] && return 1
+ [ $(nproc) -ne 1 ]
}
dmsetup_wrapped() {
diff --git a/test/shell/lvconvert-raid-reshape-linear_to_striped.sh b/test/shell/lvconvert-raid-reshape-linear_to_striped.sh
index 879c33c..042cb33 100644
--- a/test/shell/lvconvert-raid-reshape-linear_to_striped.sh
+++ b/test/shell/lvconvert-raid-reshape-linear_to_striped.sh
@@ -19,8 +19,7 @@ aux have_raid 1 10 1 || skip
# Temporarily skip reshape tests on single-core CPUs until there's a fix for
# https://bugzilla.redhat.com/1443999 - AGK 2017/04/20
-aux have_single_core && skip
-
+aux have_multi_core || skip
aux prepare_vg 5
#
diff --git a/test/shell/lvconvert-raid-reshape-striped_to_linear.sh b/test/shell/lvconvert-raid-reshape-striped_to_linear.sh
index 4c12dd7..4051862 100644
--- a/test/shell/lvconvert-raid-reshape-striped_to_linear.sh
+++ b/test/shell/lvconvert-raid-reshape-striped_to_linear.sh
@@ -19,7 +19,7 @@ aux have_raid 1 10 1 || skip
# Temporarily skip reshape tests on single-core CPUs until there's a fix for
# https://bugzilla.redhat.com/1443999 - AGK 2017/04/20
-aux have_single_core && skip
+aux have_multi_core || skip
aux prepare_vg 5
7 years
master - test: Fix skip some reshape tests that hang on single core machines
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=18bf954801e0ea3aff4...
Commit: 18bf954801e0ea3aff4b85e9511b1bbf03a07c2d
Parent: 0c2fd133d7b690889ed4153853151db5b38eb060
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Thu Apr 20 21:45:56 2017 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Thu Apr 20 21:45:56 2017 +0200
test: Fix skip some reshape tests that hang on single core machines
Fix commit c7fb0cb861104e99c11e8b4e031d981dab7891a1.
---
.../lvconvert-raid-reshape-linear_to_striped.sh | 2 +-
.../lvconvert-raid-reshape-striped_to_linear.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/shell/lvconvert-raid-reshape-linear_to_striped.sh b/test/shell/lvconvert-raid-reshape-linear_to_striped.sh
index 13769ec..879c33c 100644
--- a/test/shell/lvconvert-raid-reshape-linear_to_striped.sh
+++ b/test/shell/lvconvert-raid-reshape-linear_to_striped.sh
@@ -19,7 +19,7 @@ aux have_raid 1 10 1 || skip
# Temporarily skip reshape tests on single-core CPUs until there's a fix for
# https://bugzilla.redhat.com/1443999 - AGK 2017/04/20
-aux have_single_core || skip
+aux have_single_core && skip
aux prepare_vg 5
diff --git a/test/shell/lvconvert-raid-reshape-striped_to_linear.sh b/test/shell/lvconvert-raid-reshape-striped_to_linear.sh
index 8f53a42..4c12dd7 100644
--- a/test/shell/lvconvert-raid-reshape-striped_to_linear.sh
+++ b/test/shell/lvconvert-raid-reshape-striped_to_linear.sh
@@ -19,7 +19,7 @@ aux have_raid 1 10 1 || skip
# Temporarily skip reshape tests on single-core CPUs until there's a fix for
# https://bugzilla.redhat.com/1443999 - AGK 2017/04/20
-aux have_single_core || skip
+aux have_single_core && skip
aux prepare_vg 5
7 years