master - libdm: fix stats walk compatibility with older dmsetup
by Bryn Reeves
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=6ec8854fdb051b...
Commit: 6ec8854fdb051b092d5e262dc6c6d4c2ea075cd1
Parent: 0a480c5c52bd34a1eb8337d59a7f4cc60317d2b1
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Tue Sep 27 14:35:22 2016 +0100
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Tue Sep 27 14:46:00 2016 +0100
libdm: fix stats walk compatibility with older dmsetup
The current dmsetup.c handles DR_STATS and DR_STATS_META reports
separately in _display_info_cols(), meaning that the stats walk
functions are never called for these report types.
Versions before v2.02.159 have a loop using dm_stats_walk_do() and
dm_stats_walk_while(), that executes once for non-stats reports,
and once per region, or area, for DR_STATS/DR_STATS_META reports.
This older behaviour relies on the documented behaviour that the
walk functions will accept a NULL pointer as the struct dm_stats*
argument.
This was broken by commit f1f2df7b: the NULL test on dms and
dms->regions were incorrectly moved from the dm_stats_walk_end()
wrapper to the internal '_stats_walk_end()' helper.
Since the pointer is dereferenced in between these points, using
an older dmsetup with current libdm results in a segfault when
running a non-stats report:
# dmsetup info -c vg00/lvol0
Segmentation fault (core dumped)
Restore the NULL checks to the wrapper function as intended.
---
WHATS_NEW_DM | 1 +
libdm/libdm-stats.c | 6 +++---
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 29dbccc..b048f7a 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.136 -
======================================
+ Fix stats walk segfault with dmsetup older than v1.02.129
Version 1.02.135 - 26th September 2016
======================================
diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c
index ffd349c..75e0144 100644
--- a/libdm/libdm-stats.c
+++ b/libdm/libdm-stats.c
@@ -1526,9 +1526,6 @@ static void _stats_walk_end_areas(const struct dm_stats *dms, uint64_t *flags,
static int _stats_walk_end(const struct dm_stats *dms, uint64_t *flags,
uint64_t *cur_r, uint64_t *cur_a, uint64_t *cur_g)
{
- if (!dms || !dms->regions)
- return 1;
-
if (*flags & DM_STATS_WALK_AREA) {
_stats_walk_end_areas(dms, flags, cur_r, cur_a, cur_g);
goto out;
@@ -1553,6 +1550,9 @@ out:
int dm_stats_walk_end(struct dm_stats *dms)
{
+ if (!dms || !dms->regions)
+ return 1;
+
if (_stats_walk_end(dms, &dms->cur_flags,
&dms->cur_region, &dms->cur_area,
&dms->cur_group)) {
7 years, 2 months
master - systemd: disable service start rate limiting for lvm2-pvscan@.service
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=0a480c5c52bd34...
Commit: 0a480c5c52bd34a1eb8337d59a7f4cc60317d2b1
Parent: 397c246fe03876fb6c68cece2d4345e0fd0ca2e3
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Tue Sep 27 10:47:54 2016 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Tue Sep 27 10:48:01 2016 +0200
systemd: disable service start rate limiting for lvm2-pvscan@.service
We shouldn't be losing pvscans just because of the fact that the
underlying device (PV) appears and disappears quickly in the system,
otherwise lvmetad may not see the device if it appears again (or it may
still keep the device in cache even it's already gone).
---
WHATS_NEW | 1 +
scripts/lvm2_pvscan_systemd_red_hat@.service.in | 1 +
2 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 4346de7..aa6c0c6 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.167 -
======================================
+ Disable systemd service start rate limiting for lvm2-pvscan@.service.
Version 2.02.166 - 26th September 2016
======================================
diff --git a/scripts/lvm2_pvscan_systemd_red_hat@.service.in b/scripts/lvm2_pvscan_systemd_red_hat@.service.in
index 03651d5..0989590 100644
--- a/scripts/lvm2_pvscan_systemd_red_hat@.service.in
+++ b/scripts/lvm2_pvscan_systemd_red_hat@.service.in
@@ -2,6 +2,7 @@
Description=LVM2 PV scan on device %i
Documentation=man:pvscan(8)
DefaultDependencies=no
+StartLimitInterval=0
BindsTo=dev-block-%i.device
Requires=lvm2-lvmetad.socket
After=lvm2-lvmetad.socket lvm2-lvmetad.service
7 years, 2 months
v2_02_166 annotated tag has been created
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c3410f9296c115...
Commit: c3410f9296c115d4aa1a4f8e21dc33e1dc2dbdb6
Parent: 0000000000000000000000000000000000000000
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: 2016-09-26 13:21 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: 2016-09-26 13:21 +0000
annotated tag: v2_02_166 has been created
at c3410f9296c115d4aa1a4f8e21dc33e1dc2dbdb6 (tag)
tagging 5233a3468c8b50847ac4347539fcf6f748fcf2cc (commit)
replaces v2_02_165
Release 2.02.166.
Another release of bug fixes.
77 files changed, 3317 insertions(+), 820 deletions(-)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
iEYEABECAAYFAlfpINsACgkQIoGRwVZ+LBd3lgCglHlAwTO3tlTPHRAaxrB84HXi
pqAAoNlAb7jMqJwr1920M4IE2HhSxdS5
=G+vH
-----END PGP SIGNATURE-----
Alasdair G Kergon (6):
post-release
man: Only install lvmraid when needed.
lvmdump: Use O_DIRECT to gather metadata.
alloc: Use --alloc normal for mirror logs.
snapshots: Fix monitoring to use cow not internal LV.
pre-release
Brassow Jonathan (1):
cache: scrubbing for cache origin LV - Bug 1169495
Bryn M. Reeves (2):
libdm: fix end-of-groups test in _stats_walk_end()
dmsetup: ensure --filemap histogram bounds are freed
David Teigland (1):
lvmlockd: fix metadata validation when rescanning VG
Heinz Mauelshagen (2):
lvconvert: fix (automatic) raid repair regression
tests: fix raid rebuild tests to work with older target versions
Peter Rajnoha (9):
man: add lvmreport man page
coverity: dmsetup: fix possible use of uninitialized value
cleanup: remove unused variables
libdm: add dm_config_parse_without_dup_node_check
config: parse config tree without dup node checking if it's metadata tree
config: add config_tree_from_string_without_dup_node_check to replace dm_config_from_string where needed
config: use config_tree_from_string_without_dup_node_check throughout code to construct metadata trees
make: also clean up lvmdump.sh with substitutions - there's original lvmdump.sh.in
toolcontext: read all configuration sources when checking config values in lvm2-activation-generator through lighweight toolcontext handler
Timur Bakeyev (1):
systemd: fix extra space in unit generated by lvm2-activation-generator
Tony Asleson (9):
lvmdbusd: Vg.LvCreate* methods, correct return type
lvmdbustest.py: Make methods static
lvmdbusd: Set value to non none on error
lvmdbustest.py: Test with/without timeout values
lvmdbusd: Fix dbus object with only properties and no method
lvmdbustest: ws fix-ups
lvmdbusd: Correct imports
lvmdbustest: Remove pyudev deprecated warnings
lvmdbusd: Assign percentage on set
Zdenek Kabelac (39):
cleanup: clean gcc6 minor/major types warnings
tests: lower allocated memory
cache: report metadata percentage
lvm2app: fix cache percantage reporting
cache: fix reporting of dirty cache
tests: lowering disc usage
tests: skip synaction test in cluster for now
tests: increate delay for raid rebuild
tests: rename test _ -> -
rpm: build with raid man page
cache: fixed copy&paste from last commit
activation: dso always defined for monitoring query
tests: move cache test to separate file
tests: use exclusive activation
tests: add check function for raid leg status
tests: slow down disks more
rpm: install lvmreport.7
libdm: cleaner debug message
tests: not redirect strderr to stdout
tests: use just single raid_leg_status
tests: more permissive on test percent value
tests: slightly bigger raid arrays
tests: Revert "tests: not redirect strderr to stdout"
thin: report pool as holder when no active thin volume
thin: enforce there is some free space in thin pool metadata
thin: fix lvchange of discards and zero flag
tests: add check grep_dmsetup
tests: check for metadata test working properly
tests: enhance lvchange of thin pool tests
debug: mention origin_only in message
debug: cleanup backtrace after log_error
cache: restore reported origin field
tests: kernel message for <3.5 kernels
tests: read messages instead of syslog
tests: show some more device info
tests: correcting kernel version test
tests: check for TRIM support
tests: raid repair needs devices in-sync
man: fix dmsetup stats
7 years, 2 months
master - post-release
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=397c246fe03876...
Commit: 397c246fe03876fb6c68cece2d4345e0fd0ca2e3
Parent: 5233a3468c8b50847ac4347539fcf6f748fcf2cc
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Mon Sep 26 14:29:35 2016 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Mon Sep 26 14:29:35 2016 +0100
post-release
---
VERSION | 2 +-
VERSION_DM | 2 +-
WHATS_NEW | 3 +++
WHATS_NEW_DM | 3 +++
4 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/VERSION b/VERSION
index 4678ea0..b2fc25f 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.02.166(2)-git (2016-09-26)
+2.02.167(2)-git (2016-09-26)
diff --git a/VERSION_DM b/VERSION_DM
index 27a6d66..087153f 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.135-git (2016-09-26)
+1.02.136-git (2016-09-26)
diff --git a/WHATS_NEW b/WHATS_NEW
index 25f6742..4346de7 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,3 +1,6 @@
+Version 2.02.167 -
+======================================
+
Version 2.02.166 - 26th September 2016
======================================
Fix lvm2-activation-generator to read all LVM2 config sources. (2.02.155)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 9699f63..29dbccc 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,3 +1,6 @@
+Version 1.02.136 -
+======================================
+
Version 1.02.135 - 26th September 2016
======================================
Fix man entry for dmsetup status.
7 years, 2 months
master - pre-release
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5233a3468c8b50...
Commit: 5233a3468c8b50847ac4347539fcf6f748fcf2cc
Parent: f93cddeafd3d30a2645b0f47c3910a0f1c555b63
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Mon Sep 26 14:20:08 2016 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Mon Sep 26 14:20:08 2016 +0100
pre-release
---
VERSION | 2 +-
VERSION_DM | 2 +-
WHATS_NEW | 5 +++--
WHATS_NEW_DM | 5 +++--
4 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/VERSION b/VERSION
index eb664c4..4678ea0 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.02.166(2)-git (2016-09-07)
+2.02.166(2)-git (2016-09-26)
diff --git a/VERSION_DM b/VERSION_DM
index 55887fc..27a6d66 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.135-git (2016-09-07)
+1.02.135-git (2016-09-26)
diff --git a/WHATS_NEW b/WHATS_NEW
index d3953ff..25f6742 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,5 @@
-Version 2.02.166 -
-=====================================
+Version 2.02.166 - 26th September 2016
+======================================
Fix lvm2-activation-generator to read all LVM2 config sources. (2.02.155)
Fix lvchange-rebuild-raid.sh to cope with older target versions.
Use dm_config_parse_without_dup_node_check() to speedup metadata reading.
@@ -11,6 +11,7 @@ Version 2.02.166 -
Fix lock-holder device for thin pool with inactive thin volumes.
Use --alloc normal for mirror logs even if the mimages were stricter.
Use O_DIRECT to gather metadata in lvmdump.
+ Ignore creation_time when checking for matching metadata for lvmetad.
Fix possible NULL pointer derefence when checking for monitoring.
Add lvmreport(7) man page.
Don't install lvmraid(7) man page when raid excluded. (2.02.165)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 3ab03b2..9699f63 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,7 +1,8 @@
-Version 1.02.135 -
-=====================================
+Version 1.02.135 - 26th September 2016
+======================================
Fix man entry for dmsetup status.
Introduce new dm_config_parse_without_dup_node_check().
+ Don't omit last entry in dmstats list --group.
Version 1.02.134 - 7th September 2016
=====================================
7 years, 2 months
master - man: fix dmsetup stats
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f93cddeafd3d30...
Commit: f93cddeafd3d30a2645b0f47c3910a0f1c555b63
Parent: 70be57c8dab4a011b0f6014636d3948d10ddd8c3
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Sep 26 12:36:04 2016 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Sep 26 12:38:32 2016 +0200
man: fix dmsetup stats
Fix typo STATS -> STATUS.
---
WHATS_NEW_DM | 1 +
man/dmsetup.8.in | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 7d32dff..3ab03b2 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.135 -
=====================================
+ Fix man entry for dmsetup status.
Introduce new dm_config_parse_without_dup_node_check().
Version 1.02.134 - 7th September 2016
diff --git a/man/dmsetup.8.in b/man/dmsetup.8.in
index f92dbe5..8aa0ff7 100644
--- a/man/dmsetup.8.in
+++ b/man/dmsetup.8.in
@@ -787,14 +787,14 @@ The precise encoding might change without notice in any future
release, so we recommend you always decode using the current version of
this command.
.HP
-.BR stats " " \fIcommand " [" \fIoptions ]
+.CMD_STATS
.br
Manages IO statistics regions for devices.
See
.BR dmstats (8)
for more details.
.HP
-.CMD_STATS
+.CMD_STATUS
.br
Outputs status information for each of the device's targets.
With \fB\-\-target\fP, only information relating to the specified target type
7 years, 2 months
master - systemd: fix extra space in unit generated by lvm2-activation-generator
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=70be57c8dab4a0...
Commit: 70be57c8dab4a011b0f6014636d3948d10ddd8c3
Parent: b5e093624dc9bc9644903442e59bf049aeaaa3ba
Author: Timur Bakeyev <timur(a)gnu.org>
AuthorDate: Mon Sep 26 09:54:19 2016 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Mon Sep 26 09:54:19 2016 +0200
systemd: fix extra space in unit generated by lvm2-activation-generator
---
.../lvm2_activation_generator_systemd_red_hat.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/scripts/lvm2_activation_generator_systemd_red_hat.c b/scripts/lvm2_activation_generator_systemd_red_hat.c
index d83e721..0f7f89c 100644
--- a/scripts/lvm2_activation_generator_systemd_red_hat.c
+++ b/scripts/lvm2_activation_generator_systemd_red_hat.c
@@ -137,7 +137,7 @@ static int generate_unit(const char *dir, int unit, int sysinit_needed)
fputs("After=systemd-udev-settle.service\n"
"Before=cryptsetup.target\n", f);
} else
- fprintf(f, "After= %s cryptsetup.target\n", unit_names[UNIT_EARLY]);
+ fprintf(f, "After=%s cryptsetup.target\n", unit_names[UNIT_EARLY]);
fputs("Before=local-fs-pre.target shutdown.target\n"
"Wants=systemd-udev-settle.service\n\n"
7 years, 2 months
master - toolcontext: read all configuration sources when checking config values in lvm2-activation-generator through lighweight toolcontext handler
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b5e093624dc9bc...
Commit: b5e093624dc9bc9644903442e59bf049aeaaa3ba
Parent: dbcfd59714bddb3162d97575e66e000d2d83acb6
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Sep 23 14:51:15 2016 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Sep 23 14:57:44 2016 +0200
toolcontext: read all configuration sources when checking config values in lvm2-activation-generator through lighweight toolcontext handler
We added lightweight toolcontext handle to avoid useless initialization
of some parts of the context and also to avoid problems when using the
handle very soon at system boot, like in lvm2-activation-generator
through lvm2app interface. However, we missed reading all the other
config sources like lvmlocal.conf as well as any tag config - we need to
read these too to get the final config value which may be overriden in
any of these additional config sources.
Currently, we use this lightweight toolcontext handle to read
global/use_lvmetad and global/use_lvmpolld config values in
lvm2-activation-generator using lvm2app interface (lvm_config_find_bool
lvm2app function).
---
WHATS_NEW | 1 +
lib/commands/toolcontext.c | 17 +++++++++++++++++
2 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 6a178e6..d3953ff 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.166 -
=====================================
+ Fix lvm2-activation-generator to read all LVM2 config sources. (2.02.155)
Fix lvchange-rebuild-raid.sh to cope with older target versions.
Use dm_config_parse_without_dup_node_check() to speedup metadata reading.
Fix lvconvert --repair regression
diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
index eaabf98..c416575 100644
--- a/lib/commands/toolcontext.c
+++ b/lib/commands/toolcontext.c
@@ -1787,10 +1787,27 @@ struct cmd_context *create_config_context(void)
goto_out;
dm_list_init(&cmd->config_files);
+ dm_list_init(&cmd->tags);
if (!_init_lvm_conf(cmd))
goto_out;
+ if (!_init_hostname(cmd))
+ goto_out;
+
+ if (!_init_tags(cmd, cmd->cft))
+ goto_out;
+
+ /* Load lvmlocal.conf */
+ if (*cmd->system_dir && !_load_config_file(cmd, "", 1))
+ goto_out;
+
+ if (!_init_tag_configs(cmd))
+ goto_out;
+
+ if (!(cmd->cft = _merge_config_files(cmd, cmd->cft)))
+ goto_out;
+
return cmd;
out:
if (cmd)
7 years, 2 months
master - make: also clean up lvmdump.sh with substitutions - there's original lvmdump.sh.in
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=dbcfd59714bddb...
Commit: dbcfd59714bddb3162d97575e66e000d2d83acb6
Parent: f2efd04052c9cdd86d636e77e645db778935fdc8
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Sep 23 12:48:52 2016 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Sep 23 12:48:52 2016 +0200
make: also clean up lvmdump.sh with substitutions - there's original lvmdump.sh.in
---
scripts/Makefile.in | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/scripts/Makefile.in b/scripts/Makefile.in
index e674239..9c28956 100644
--- a/scripts/Makefile.in
+++ b/scripts/Makefile.in
@@ -158,6 +158,7 @@ DISTCLEAN_TARGETS += \
com.redhat.lvmdbus1.service \
dm_event_systemd_red_hat.service \
dm_event_systemd_red_hat.socket \
+ lvmdump.sh \
lvm2_cluster_activation_red_hat.sh \
lvm2_cluster_activation_systemd_red_hat.service \
lvm2_clvmd_systemd_red_hat.service \
7 years, 2 months
master - tests: fix raid rebuild tests to work with older target versions
by Heinz Mauelshagen
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f2efd04052c9cd...
Commit: f2efd04052c9cdd86d636e77e645db778935fdc8
Parent: 38a6a39daa2967970da0017ac96e40af1c7fbc7b
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Thu Sep 22 23:35:37 2016 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Thu Sep 22 23:35:37 2016 +0200
tests: fix raid rebuild tests to work with older target versions
Pre 1.9 dm-raid targets status output was racy, which caused
the device status chars to be unreliable _during_ synchronization.
This shows paritcularly with tiny test devices used.
Enhance lvchange-rebuild-raid.sh to not check status
chars _during_ synchronization. Just check afterwards.
---
WHATS_NEW | 1 +
test/shell/lvchange-rebuild-raid.sh | 42 ++++++++++++++++++++++++----------
2 files changed, 30 insertions(+), 13 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index aedacee..6a178e6 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.166 -
=====================================
+ Fix lvchange-rebuild-raid.sh to cope with older target versions.
Use dm_config_parse_without_dup_node_check() to speedup metadata reading.
Fix lvconvert --repair regression
Fix reported origin lv field for cache volumes. (2.02.133)
diff --git a/test/shell/lvchange-rebuild-raid.sh b/test/shell/lvchange-rebuild-raid.sh
index f15c5ef..6b91941 100644
--- a/test/shell/lvchange-rebuild-raid.sh
+++ b/test/shell/lvchange-rebuild-raid.sh
@@ -18,7 +18,7 @@ aux have_raid 1 3 2 || skip
aux prepare_vg 8
-# Delay 1st leg so that rebuilding status characters can be read
+# Delay legs so that rebuilding status characters can be read
for d in $(< DEVICES)
do
aux delay_dev "$d" 0 15 $(get first_extent_sector "$d")
@@ -37,92 +37,108 @@ aux wait_for_sync $vg $lv1
not lvchange --yes --rebuild "$dev1" --rebuild "$dev2" $vg/$lv1
not check raid_leg_status $vg $lv1 "aAaAAAAA"
aux wait_for_sync $vg $lv1
+check raid_leg_status $vg $lv1 "AAAAAAAA"
-# Rebuild 1st and 3nd device from different mirror groups is fine.
+# Rebuild 1st and 3rd device from different mirror groups is fine.
lvchange --yes --rebuild "$dev1" --rebuild "$dev3" $vg/$lv1
-check raid_leg_status $vg $lv1 "aAaAAAAA"
+aux have_raid 1 9 && check raid_leg_status $vg $lv1 "aAaAAAAA"
aux wait_for_sync $vg $lv1
+check raid_leg_status $vg $lv1 "AAAAAAAA"
# Rebuild devices 1, 3, 6 from different mirror groups is fine.
lvchange --yes --rebuild "$dev1" --rebuild "$dev3" --rebuild "$dev6" $vg/$lv1
-check raid_leg_status $vg $lv1 "aAaAAaAA"
+aux have_raid 1 9 && check raid_leg_status $vg $lv1 "aAaAAaAA"
aux wait_for_sync $vg $lv1
+check raid_leg_status $vg $lv1 "AAAAAAAA"
# Rebuild devices 1, 3, 5 and 6 with 5+6 being
# being a whole mirror group needs to be rejected.
not lvchange --yes --rebuild "$dev1" --rebuild "$dev3" --rebuild "$dev6" --rebuild "$dev5" $vg/$lv1
not check raid_leg_status $vg $lv1 "aAaAaaAA"
aux wait_for_sync $vg $lv1
+check raid_leg_status $vg $lv1 "AAAAAAAA"
# Rebuild devices 1, 3, 5 and 7 from different mirror groups is fine.
lvchange --yes --rebuild "$dev1" --rebuild "$dev3" --rebuild "$dev5" --rebuild "$dev7" $vg/$lv1
-check raid_leg_status $vg $lv1 "aAaAaAaA"
+aux have_raid 1 9 && check raid_leg_status $vg $lv1 "aAaAaAaA"
aux wait_for_sync $vg $lv1
# Rebuild devices 2, 4, 6 and 8 from different mirror groups is fine.
lvchange --yes --rebuild "$dev2" --rebuild "$dev4" --rebuild "$dev6" --rebuild "$dev8" $vg/$lv1
-check raid_leg_status $vg $lv1 "AaAaAaAa"
+aux have_raid 1 9 && check raid_leg_status $vg $lv1 "AaAaAaAa"
aux wait_for_sync $vg $lv1
+check raid_leg_status $vg $lv1 "AAAAAAAA"
##############################################
# Create an 8-legged raid1 and rebuild selected PVs
lvremove --yes $vg/$lv1
lvcreate --yes --type raid1 -m 7 -l 2 -n $lv1 $vg
aux wait_for_sync $vg $lv1
+check raid_leg_status $vg $lv1 "AAAAAAAA"
# Rebuilding all raid1 legs needs to be rejected.
not lvchange --yes --rebuild "$dev1" --rebuild "$dev2" --rebuild "$dev3" --rebuild "$dev4" \
--rebuild "$dev5" --rebuild "$dev6" --rebuild "$dev7" --rebuild "$dev8" $vg/$lv1
not check raid_leg_status $vg $lv1 "aaaaaaaa"
aux wait_for_sync $vg $lv1
+check raid_leg_status $vg $lv1 "AAAAAAAA"
# Rebuilding all but the raid1 master leg is fine.
lvchange --yes --rebuild "$dev2" --rebuild "$dev3" --rebuild "$dev4" \
--rebuild "$dev5" --rebuild "$dev6" --rebuild "$dev7" --rebuild "$dev8" $vg/$lv1
-check raid_leg_status $vg $lv1 "Aaaaaaaa"
+aux have_raid 1 9 && check raid_leg_status $vg $lv1 "Aaaaaaaa"
aux wait_for_sync $vg $lv1
+check raid_leg_status $vg $lv1 "AAAAAAAA"
# Rebuilding the raid1 master leg is fine.
lvchange --yes --rebuild "$dev1" $vg/$lv1
-check raid_leg_status $vg $lv1 "aAAAAAAA"
+aux have_raid 1 9 && check raid_leg_status $vg $lv1 "aAAAAAAA"
aux wait_for_sync $vg $lv1
+check raid_leg_status $vg $lv1 "AAAAAAAA"
# Rebuild legs on devices 2, 4, 6 and 8 is fine.
lvchange --yes --rebuild "$dev2" --rebuild "$dev4" --rebuild "$dev6" --rebuild "$dev8" $vg/$lv1
-check raid_leg_status $vg $lv1 "AaAaAaAa"
+aux have_raid 1 9 && check raid_leg_status $vg $lv1 "AaAaAaAa"
aux wait_for_sync $vg $lv1
+check raid_leg_status $vg $lv1 "AAAAAAAA"
##############################################
# Create an 6-legged raid6 and rebuild selected PVs
lvremove --yes $vg/$lv1
lvcreate --yes --type raid6 -i 4 -l 2 -n $lv1 $vg
aux wait_for_sync $vg $lv1
+check raid_leg_status $vg $lv1 "AAAAAA"
# Rebuilding all raid6 stripes needs to be rejected.
not lvchange --yes --rebuild "$dev1" --rebuild "$dev2" --rebuild "$dev3" \
--rebuild "$dev4" --rebuild "$dev5" --rebuild "$dev6" $vg/$lv1
not check raid_leg_status $vg $lv1 "aaaaaa"
aux wait_for_sync $vg $lv1
+check raid_leg_status $vg $lv1 "AAAAAA"
# Rebuilding more than 2 raid6 stripes needs to be rejected.
not lvchange --yes --rebuild "$dev2" --rebuild "$dev4" --rebuild "$dev6" $vg/$lv1
not check raid_leg_status $vg $lv1 "AaAaAa"
aux wait_for_sync $vg $lv1
+check raid_leg_status $vg $lv1 "AAAAAA"
# Rebuilding any 1 raid6 stripe is fine.
lvchange --yes --rebuild "$dev2" $vg/$lv1
-check raid_leg_status $vg $lv1 "AaAAAA"
+aux have_raid 1 9 && check raid_leg_status $vg $lv1 "AaAAAA"
aux wait_for_sync $vg $lv1
lvchange --yes --rebuild "$dev5" $vg/$lv1
-check raid_leg_status $vg $lv1 "AAAAaA"
+aux have_raid 1 9 && check raid_leg_status $vg $lv1 "AAAAaA"
aux wait_for_sync $vg $lv1
+check raid_leg_status $vg $lv1 "AAAAAA"
# Rebuilding any 2 raid6 stripes is fine.
lvchange --yes --rebuild "$dev2" --rebuild "$dev4" $vg/$lv1
-check raid_leg_status $vg $lv1 "AaAaAA"
+aux have_raid 1 9 && check raid_leg_status $vg $lv1 "AaAaAA"
aux wait_for_sync $vg $lv1
+check raid_leg_status $vg $lv1 "AAAAAA"
lvchange --yes --rebuild "$dev1" --rebuild "$dev5" $vg/$lv1
-check raid_leg_status $vg $lv1 "aAAAaA"
+aux have_raid 1 9 && check raid_leg_status $vg $lv1 "aAAAaA"
aux wait_for_sync $vg $lv1
+check raid_leg_status $vg $lv1 "AAAAAA"
vgremove -ff $vg
7 years, 2 months