master - lvmlockd: fix metadata validation when rescanning VG
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d455300d7baff3...
Commit: d455300d7baff341f1c7fe5776d975369dd3a23a
Parent: 629059ee84e83b9d013d80e0b382a3474b30c7a4
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Sep 13 16:50:47 2016 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Sep 14 10:43:33 2016 -0500
lvmlockd: fix metadata validation when rescanning VG
When rescanning a VG from disk, the metadata read from
each PV was compared as a sanity check. The comparison
is done by exporting the vg metadata from each dev to
a config tree, and then comparing the config trees.
The function to create the config tree inserts
extraneous information along with the actual VG metadata.
This extra info includes creation_time. The config
trees for two devs can easily be created one second
apart in which case the different creation_times would
cause the metadata comparison to fail. The fix is to
exclude the extraneous info from the metadata comparison.
---
lib/cache/lvmetad.c | 31 ++++++++++++++++++++++++++++++-
1 files changed, 30 insertions(+), 1 deletions(-)
diff --git a/lib/cache/lvmetad.c b/lib/cache/lvmetad.c
index b3cd1bf..727d3d3 100644
--- a/lib/cache/lvmetad.c
+++ b/lib/cache/lvmetad.c
@@ -1918,15 +1918,44 @@ scan_more:
vgmeta_ret = vgmeta;
save_dev = devl->dev;
} else {
- if (compare_config(vgmeta_ret->root, vgmeta->root)) {
+ struct dm_config_node *meta1 = vgmeta_ret->root;
+ struct dm_config_node *meta2 = vgmeta->root;
+ struct dm_config_node *sib1 = meta1->sib;
+ struct dm_config_node *sib2 = meta2->sib;
+
+ /*
+ * Do not compare the extraneous data that
+ * export_vg_to_config_tree() inserts next to the
+ * actual VG metadata. This includes creation_time
+ * which may not match since it is generated separately
+ * for each call to create the config tree.
+ *
+ * We're saving the sibling pointer and restoring it
+ * after the compare because we're unsure if anything
+ * later might want it.
+ *
+ * FIXME: make it clearer what we're doing here, e.g.
+ * pass a parameter to export_vg_to_config_tree()
+ * telling it to skip the extraneous data, or something.
+ * It's very non-obvious that setting sib=NULL does that.
+ */
+ meta1->sib = NULL;
+ meta2->sib = NULL;
+
+ if (compare_config(meta1, meta2)) {
log_error("VG %s metadata comparison failed for device %s vs %s",
vg->name, dev_name(devl->dev), save_dev ? dev_name(save_dev) : "none");
_log_debug_inequality(vg->name, vgmeta_ret->root, vgmeta->root);
+
+ meta1->sib = sib1;
+ meta2->sib = sib2;
dm_config_destroy(vgmeta);
dm_config_destroy(vgmeta_ret);
release_vg(baton.vg);
return NULL;
}
+ meta1->sib = sib1;
+ meta2->sib = sib2;
dm_config_destroy(vgmeta);
}
6 years, 8 months
master - tests: Revert "tests: not redirect strderr to stdout"
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=629059ee84e83b...
Commit: 629059ee84e83b9d013d80e0b382a3474b30c7a4
Parent: cebcc8a6040e44223e466572ee899c591b42e5d4
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Sep 13 13:23:47 2016 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Sep 13 13:23:47 2016 +0200
tests: Revert "tests: not redirect strderr to stdout"
This reverts commit 5314d36f3d186efb05a051e80444332f743194ef.
Ok - some tests do look for 'stderr' output of 'not' commands.
So let's keep existing functionality.
---
test/lib/not.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/test/lib/not.c b/test/lib/not.c
index 4ce77b6..a5c52a8 100644
--- a/test/lib/not.c
+++ b/test/lib/not.c
@@ -72,12 +72,9 @@ int main(int args, char **argv) {
fprintf(stderr, "Could not fork\n");
return FAILURE;
} else if (pid == 0) { /* child */
- if (!strcmp(argv[0], "not")) {
+ if (!strcmp(argv[0], "not"))
val = ">1";
- /* Redirect 'expected' error output */
- fflush(stderr);
- dup2(fileno(stdout), fileno(stderr));
- } else if (!strcmp(argv[0], "invalid"))
+ else if (!strcmp(argv[0], "invalid"))
val = "3";
else if (!strcmp(argv[0], "fail"))
val = "5";
6 years, 8 months
master - tests: slightly bigger raid arrays
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=cebcc8a6040e44...
Commit: cebcc8a6040e44223e466572ee899c591b42e5d4
Parent: 08c94de79895ac94ebc346fc440dbb23eaa98b45
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Sep 13 12:23:46 2016 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Sep 13 12:25:36 2016 +0200
tests: slightly bigger raid arrays
Just to ensure we catch devices in sync.
---
test/shell/lvcreate-raid-nosync.sh | 15 +++++++--------
1 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/test/shell/lvcreate-raid-nosync.sh b/test/shell/lvcreate-raid-nosync.sh
index 801ef53..fdb4f68 100644
--- a/test/shell/lvcreate-raid-nosync.sh
+++ b/test/shell/lvcreate-raid-nosync.sh
@@ -32,7 +32,7 @@ do
done
# raid1 supports resynchronization
-lvcreate --yes --type raid1 -m 2 -l 1 -n $lv1 $vg
+lvcreate --yes --type raid1 -m 2 -l 2 -n $lv1 $vg
check raid_leg_status $vg $lv1 "aaa"
aux wait_for_sync $vg $lv1
check raid_leg_status $vg $lv1 "AAA"
@@ -46,20 +46,19 @@ lvremove --yes $vg/$lv1
for r in raid4 raid5
do
# raid4/5 support resynchronization
- lvcreate --yes --type $r -i 3 -l 1 -n $lv1 $vg
+ lvcreate --yes --type $r -i 3 -l 2 -n $lv1 $vg
check raid_leg_status $vg $lv1 "aaaa"
aux wait_for_sync $vg $lv1
check raid_leg_status $vg $lv1 "AAAA"
- lvremove --yes $vg/$lv1
# raid4/5 support --nosync
- lvcreate --yes --type $r --nosync -i 3 -l 1 -n $lv1 $vg
- check raid_leg_status $vg $lv1 "AAAA"
- lvremove --yes $vg/$lv1
+ lvcreate --yes --type $r --nosync -i 3 -l 1 -n $lv2 $vg
+ check raid_leg_status $vg $lv2 "AAAA"
+ lvremove --yes $vg
done
# raid6 supports resynchronization
-lvcreate --yes --type raid6 -i 3 -l 1 -n $lv1 $vg
+lvcreate --yes --type raid6 -i 3 -l 2 -n $lv1 $vg
check raid_leg_status $vg $lv1 "aaaaa"
aux wait_for_sync $vg $lv1
check raid_leg_status $vg $lv1 "AAAAA"
@@ -69,7 +68,7 @@ lvremove --yes $vg/$lv1
not lvcreate --yes --type raid6 --nosync -i 3 -l 1 -n $lv1 $vg
# raid10 supports resynchronization
-lvcreate --yes --type raid10 -m 1 -i 3 -l 1 -n $lv1 $vg
+lvcreate --yes --type raid10 -m 1 -i 3 -l 2 -n $lv1 $vg
check raid_leg_status $vg $lv1 "aaaaaa"
aux wait_for_sync $vg $lv1
check raid_leg_status $vg $lv1 "AAAAAA"
6 years, 8 months
master - tests: more permissive on test percent value
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=08c94de79895ac...
Commit: 08c94de79895ac94ebc346fc440dbb23eaa98b45
Parent: d34e315b8dbe3bd469499e62feb02b27aaf7b179
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Sep 13 11:30:16 2016 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Sep 13 12:25:36 2016 +0200
tests: more permissive on test percent value
Just check there is some output.
Values may slightly differ per policy target version.
---
test/shell/lvcreate-cache.sh | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/test/shell/lvcreate-cache.sh b/test/shell/lvcreate-cache.sh
index c53d243..bed3ec2 100644
--- a/test/shell/lvcreate-cache.sh
+++ b/test/shell/lvcreate-cache.sh
@@ -86,11 +86,12 @@ lvcreate --type cache-pool -L1 $vg/cpool
lvcreate -H -L4 -n $lv1 $vg/cpool
check lv_field $vg/$lv1 copy_percent "0.00"
-check lv_field $vg/$lv1 data_percent "0.00"
-check lv_field $vg/$lv1 metadata_percent "0.78"
+# there should be something present (value differs per policy version)
+test -n "$(get lv_field $vg/$lv1 data_percent)"
+test -n "$(get lv_field $vg/$lv1 metadata_percent)"
check lv_field $vg/cpool copy_percent "0.00"
-check lv_field $vg/cpool data_percent "0.00"
-check lv_field $vg/cpool metadata_percent "0.78"
+test -n "$(get lv_field $vg/cpool data_percent)"
+test -n "$(get lv_field $vg/cpool metadata_percent)"
# check we also display percent value for segmented output (-o+devices)
lvs -a -o+devices $vg/cpool | tee out
grep "0.00" out
6 years, 8 months
master - tests: use just single raid_leg_status
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d34e315b8dbe3b...
Commit: d34e315b8dbe3bd469499e62feb02b27aaf7b179
Parent: 5314d36f3d186efb05a051e80444332f743194ef
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Sep 13 11:27:36 2016 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Sep 13 12:25:36 2016 +0200
tests: use just single raid_leg_status
Simplify 'check' test actualy and correct printed tracing output
---
test/lib/check.sh | 10 +++-------
test/shell/lvchange-rebuild-raid.sh | 22 +++++++++++-----------
test/shell/lvcreate-large-raid.sh | 18 +++++++++---------
test/shell/lvcreate-raid-nosync.sh | 24 ++++++++++++------------
4 files changed, 35 insertions(+), 39 deletions(-)
diff --git a/test/lib/check.sh b/test/lib/check.sh
index f0e4f0b..9dd8635 100644
--- a/test/lib/check.sh
+++ b/test/lib/check.sh
@@ -392,16 +392,12 @@ sysfs() {
die "$1: $P = $val differs from expected value $3!"
}
-# check status_chars $vg $lv "Aaaaa"
+# check raid_leg_status $vg $lv "Aaaaa"
raid_leg_status() {
local st=$(dmsetup status $1-$2)
local val=$(echo "$st" | cut -d ' ' -f 6)
- test "$val" = "$3"
-}
-
-raid_leg_status_is() {
- raid_leg_status "$@" || \
- die "Raid leg status $val differs from expected value $3 ($1-$2 $st)!"
+ test "$val" = "$3" || \
+ die "$1-$2 status $val != $3 ($st)"
}
#set -x
diff --git a/test/shell/lvchange-rebuild-raid.sh b/test/shell/lvchange-rebuild-raid.sh
index 6cc500d..f15c5ef 100644
--- a/test/shell/lvchange-rebuild-raid.sh
+++ b/test/shell/lvchange-rebuild-raid.sh
@@ -40,12 +40,12 @@ aux wait_for_sync $vg $lv1
# Rebuild 1st and 3nd device from different mirror groups is fine.
lvchange --yes --rebuild "$dev1" --rebuild "$dev3" $vg/$lv1
-check raid_leg_status_is $vg $lv1 "aAaAAAAA"
+check raid_leg_status $vg $lv1 "aAaAAAAA"
aux wait_for_sync $vg $lv1
# 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_is $vg $lv1 "aAaAAaAA"
+check raid_leg_status $vg $lv1 "aAaAAaAA"
aux wait_for_sync $vg $lv1
# Rebuild devices 1, 3, 5 and 6 with 5+6 being
@@ -56,12 +56,12 @@ aux wait_for_sync $vg $lv1
# 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_is $vg $lv1 "aAaAaAaA"
+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_is $vg $lv1 "AaAaAaAa"
+check raid_leg_status $vg $lv1 "AaAaAaAa"
aux wait_for_sync $vg $lv1
##############################################
@@ -79,17 +79,17 @@ aux wait_for_sync $vg $lv1
# 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_is $vg $lv1 "Aaaaaaaa"
+check raid_leg_status $vg $lv1 "Aaaaaaaa"
aux wait_for_sync $vg $lv1
# Rebuilding the raid1 master leg is fine.
lvchange --yes --rebuild "$dev1" $vg/$lv1
-check raid_leg_status_is $vg $lv1 "aAAAAAAA"
+check raid_leg_status $vg $lv1 "aAAAAAAA"
aux wait_for_sync $vg $lv1
# 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_is $vg $lv1 "AaAaAaAa"
+check raid_leg_status $vg $lv1 "AaAaAaAa"
aux wait_for_sync $vg $lv1
##############################################
@@ -111,18 +111,18 @@ aux wait_for_sync $vg $lv1
# Rebuilding any 1 raid6 stripe is fine.
lvchange --yes --rebuild "$dev2" $vg/$lv1
-check raid_leg_status_is $vg $lv1 "AaAAAA"
+check raid_leg_status $vg $lv1 "AaAAAA"
aux wait_for_sync $vg $lv1
lvchange --yes --rebuild "$dev5" $vg/$lv1
-check raid_leg_status_is $vg $lv1 "AAAAaA"
+check raid_leg_status $vg $lv1 "AAAAaA"
aux wait_for_sync $vg $lv1
# Rebuilding any 2 raid6 stripes is fine.
lvchange --yes --rebuild "$dev2" --rebuild "$dev4" $vg/$lv1
-check raid_leg_status_is $vg $lv1 "AaAaAA"
+check raid_leg_status $vg $lv1 "AaAaAA"
aux wait_for_sync $vg $lv1
lvchange --yes --rebuild "$dev1" --rebuild "$dev5" $vg/$lv1
-check raid_leg_status_is $vg $lv1 "aAAAaA"
+check raid_leg_status $vg $lv1 "aAAAaA"
aux wait_for_sync $vg $lv1
vgremove -ff $vg
diff --git a/test/shell/lvcreate-large-raid.sh b/test/shell/lvcreate-large-raid.sh
index d8d077c..11a69d4 100644
--- a/test/shell/lvcreate-large-raid.sh
+++ b/test/shell/lvcreate-large-raid.sh
@@ -43,20 +43,20 @@ done
# 200 TiB raid1
lvcreate --type raid1 -m 1 -L 200T -n $lv1 $vg1 --nosync
check lv_field $vg1/$lv1 size "200.00t"
-check raid_leg_status_is $vg1 $lv1 "AA"
+check raid_leg_status $vg1 $lv1 "AA"
lvremove -ff $vg1
# 1 PiB raid1
lvcreate --type raid1 -m 1 -L 1P -n $lv1 $vg1 --nosync
check lv_field $vg1/$lv1 size "1.00p"
-check raid_leg_status_is $vg1 $lv1 "AA"
+check raid_leg_status $vg1 $lv1 "AA"
lvremove -ff $vg1
# 750 TiB raid4/5
for segtype in raid4 raid5; do
lvcreate --type $segtype -i 3 -L 750T -n $lv1 $vg1 --nosync
check lv_field $vg1/$lv1 size "750.00t"
- check raid_leg_status_is $vg1 $lv1 "AAAA"
+ check raid_leg_status $vg1 $lv1 "AAAA"
lvremove -ff $vg1
done
@@ -65,10 +65,10 @@ done
#
lvcreate --type raid1 -m 1 -L 200T -n $lv1 $vg1 --nosync
check lv_field $vg1/$lv1 size "200.00t"
-check raid_leg_status_is $vg1 $lv1 "AA"
+check raid_leg_status $vg1 $lv1 "AA"
lvextend -L +200T $vg1/$lv1
check lv_field $vg1/$lv1 size "400.00t"
-check raid_leg_status_is $vg1 $lv1 "AA"
+check raid_leg_status $vg1 $lv1 "AA"
lvremove -ff $vg1
@@ -80,16 +80,16 @@ fi
# 750 TiB raid6
lvcreate --type raid6 -i 3 -L 750T -n $lv1 $vg1
check lv_field $vg1/$lv1 size "750.00t"
-check raid_leg_status_is $vg1 $lv1 "aaaaa"
+check raid_leg_status $vg1 $lv1 "aaaaa"
lvremove -ff $vg1
# 1 PiB raid6, then extend up to 2 PiB
lvcreate --type raid6 -i 3 -L 1P -n $lv1 $vg1
check lv_field $vg1/$lv1 size "1.00p"
-check raid_leg_status_is $vg1 $lv1 "aaaaa"
+check raid_leg_status $vg1 $lv1 "aaaaa"
lvextend -L +1P $vg1/$lv1
check lv_field $vg1/$lv1 size "2.00p"
-check raid_leg_status_is $vg1 $lv1 "aaaaa"
+check raid_leg_status $vg1 $lv1 "aaaaa"
lvremove -ff $vg1
#
@@ -98,7 +98,7 @@ lvremove -ff $vg1
lvcreate -aey -L 200T -n $lv1 $vg1
lvconvert --type raid1 -m 1 $vg1/$lv1
check lv_field $vg1/$lv1 size "200.00t"
-check raid_leg_status_is $vg1 $lv1 "aa"
+check raid_leg_status $vg1 $lv1 "aa"
lvremove -ff $vg1
# bz837927 END
diff --git a/test/shell/lvcreate-raid-nosync.sh b/test/shell/lvcreate-raid-nosync.sh
index 14ea8af..801ef53 100644
--- a/test/shell/lvcreate-raid-nosync.sh
+++ b/test/shell/lvcreate-raid-nosync.sh
@@ -27,42 +27,42 @@ aux delay_dev "$dev1" 0 10 $(get first_extent_sector "$dev1")
for r in raid0 raid0_meta
do
lvcreate --yes --type raid0 -i 3 -l 1 -n $lv1 $vg
- check raid_leg_status_is $vg $lv1 "AAA"
+ check raid_leg_status $vg $lv1 "AAA"
lvremove --yes $vg/$lv1
done
# raid1 supports resynchronization
lvcreate --yes --type raid1 -m 2 -l 1 -n $lv1 $vg
-check raid_leg_status_is $vg $lv1 "aaa"
+check raid_leg_status $vg $lv1 "aaa"
aux wait_for_sync $vg $lv1
-check raid_leg_status_is $vg $lv1 "AAA"
+check raid_leg_status $vg $lv1 "AAA"
lvremove --yes $vg/$lv1
# raid1 supports --nosync
lvcreate --yes --type raid1 --nosync -m 2 -l 1 -n $lv1 $vg
-check raid_leg_status_is $vg $lv1 "AAA"
+check raid_leg_status $vg $lv1 "AAA"
lvremove --yes $vg/$lv1
for r in raid4 raid5
do
# raid4/5 support resynchronization
lvcreate --yes --type $r -i 3 -l 1 -n $lv1 $vg
- check raid_leg_status_is $vg $lv1 "aaaa"
+ check raid_leg_status $vg $lv1 "aaaa"
aux wait_for_sync $vg $lv1
- check raid_leg_status_is $vg $lv1 "AAAA"
+ check raid_leg_status $vg $lv1 "AAAA"
lvremove --yes $vg/$lv1
# raid4/5 support --nosync
lvcreate --yes --type $r --nosync -i 3 -l 1 -n $lv1 $vg
- check raid_leg_status_is $vg $lv1 "AAAA"
+ check raid_leg_status $vg $lv1 "AAAA"
lvremove --yes $vg/$lv1
done
# raid6 supports resynchronization
lvcreate --yes --type raid6 -i 3 -l 1 -n $lv1 $vg
-check raid_leg_status_is $vg $lv1 "aaaaa"
+check raid_leg_status $vg $lv1 "aaaaa"
aux wait_for_sync $vg $lv1
-check raid_leg_status_is $vg $lv1 "AAAAA"
+check raid_leg_status $vg $lv1 "AAAAA"
lvremove --yes $vg/$lv1
# raid6 rejects --nosync; it has to initialize P- and Q-Syndromes
@@ -70,15 +70,15 @@ not lvcreate --yes --type raid6 --nosync -i 3 -l 1 -n $lv1 $vg
# raid10 supports resynchronization
lvcreate --yes --type raid10 -m 1 -i 3 -l 1 -n $lv1 $vg
-check raid_leg_status_is $vg $lv1 "aaaaaa"
+check raid_leg_status $vg $lv1 "aaaaaa"
aux wait_for_sync $vg $lv1
-check raid_leg_status_is $vg $lv1 "AAAAAA"
+check raid_leg_status $vg $lv1 "AAAAAA"
aux wait_for_sync $vg $lv1
lvremove --yes $vg/$lv1
# raid10 supports --nosync
lvcreate --yes --type raid10 --nosync -m 1 -i 3 -l 1 -n $lv1 $vg
-check raid_leg_status_is $vg $lv1 "AAAAAA"
+check raid_leg_status $vg $lv1 "AAAAAA"
aux wait_for_sync $vg $lv1
lvremove --yes $vg/$lv1
6 years, 8 months
master - tests: not redirect strderr to stdout
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5314d36f3d186e...
Commit: 5314d36f3d186efb05a051e80444332f743194ef
Parent: a156fc9a5431cef6a3435e796da6eac4d34c905f
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Sep 13 11:55:08 2016 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Sep 13 12:25:06 2016 +0200
tests: not redirect strderr to stdout
Errors are 'wanted' and expected in this case.
---
test/lib/not.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/test/lib/not.c b/test/lib/not.c
index a5c52a8..4ce77b6 100644
--- a/test/lib/not.c
+++ b/test/lib/not.c
@@ -72,9 +72,12 @@ int main(int args, char **argv) {
fprintf(stderr, "Could not fork\n");
return FAILURE;
} else if (pid == 0) { /* child */
- if (!strcmp(argv[0], "not"))
+ if (!strcmp(argv[0], "not")) {
val = ">1";
- else if (!strcmp(argv[0], "invalid"))
+ /* Redirect 'expected' error output */
+ fflush(stderr);
+ dup2(fileno(stdout), fileno(stderr));
+ } else if (!strcmp(argv[0], "invalid"))
val = "3";
else if (!strcmp(argv[0], "fail"))
val = "5";
6 years, 8 months
master - libdm: cleaner debug message
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a156fc9a5431ce...
Commit: a156fc9a5431cef6a3435e796da6eac4d34c905f
Parent: 5bf1778e33b07a75aeb8a0f2d42737623e9e8699
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Sep 13 09:24:38 2016 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Sep 13 09:24:38 2016 +0200
libdm: cleaner debug message
---
libdm/libdm-deptree.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c
index d74bb9c..cf6a06e 100644
--- a/libdm/libdm-deptree.c
+++ b/libdm/libdm-deptree.c
@@ -1783,7 +1783,7 @@ int dm_tree_suspend_children(struct dm_tree_node *dnode,
if (!(r = _node_send_messages(child, uuid_prefix, uuid_prefix_len, 1)))
stack;
else {
- log_debug_activation("Sent messages to thin-pool %s."
+ log_debug_activation("Sent messages to thin-pool %s and "
"skipping suspend of its children.",
_node_name(child));
child->props.skip_suspend++;
6 years, 8 months
master - rpm: install lvmreport.7
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5bf1778e33b07a...
Commit: 5bf1778e33b07a75aeb8a0f2d42737623e9e8699
Parent: 4ddcbe22b7f8004346a3b08ad09954f319baab2a
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Sep 12 16:40:42 2016 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Sep 12 16:51:53 2016 +0200
rpm: install lvmreport.7
---
spec/packages.inc | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/spec/packages.inc b/spec/packages.inc
index b74b3bd..41f6ff7 100644
--- a/spec/packages.inc
+++ b/spec/packages.inc
@@ -99,6 +99,7 @@ fi
%endif
%{_mandir}/man5/lvm.conf.5.gz
%{_mandir}/man7/lvmsystemid.7.gz
+%{_mandir}/man7/lvmreport.7.gz
%{_mandir}/man7/lvmraid.7.gz
%{_mandir}/man8/blkdeactivate.8.gz
%{_mandir}/man8/fsadm.8.gz
6 years, 8 months
master - tests: slow down disks more
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=4ddcbe22b7f800...
Commit: 4ddcbe22b7f8004346a3b08ad09954f319baab2a
Parent: 5b55f9616df036078a2cfbfc6b7a19a1f31d7f22
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Sep 12 16:48:09 2016 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Sep 12 16:51:53 2016 +0200
tests: slow down disks more
---
test/shell/lvchange-rebuild-raid.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/shell/lvchange-rebuild-raid.sh b/test/shell/lvchange-rebuild-raid.sh
index e4c579e..6cc500d 100644
--- a/test/shell/lvchange-rebuild-raid.sh
+++ b/test/shell/lvchange-rebuild-raid.sh
@@ -21,7 +21,7 @@ aux prepare_vg 8
# Delay 1st leg so that rebuilding status characters can be read
for d in $(< DEVICES)
do
- aux delay_dev "$d" 0 10 $(get first_extent_sector "$d")
+ aux delay_dev "$d" 0 15 $(get first_extent_sector "$d")
done
# rhbz 1064592
6 years, 8 months
master - tests: add check function for raid leg status
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5b55f9616df036...
Commit: 5b55f9616df036078a2cfbfc6b7a19a1f31d7f22
Parent: 44f1f45e16d4e6111e1dfd79a485697385e04160
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Sep 12 15:44:09 2016 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Sep 12 16:51:53 2016 +0200
tests: add check function for raid leg status
2 new check test functions:
raid_leg_status - to just compare
raid_leg_status_is - to compare and die when different
---
test/lib/aux.sh | 6 ------
test/lib/check.sh | 12 ++++++++++++
test/shell/lvchange-rebuild-raid.sh | 32 ++++++++++++++++----------------
test/shell/lvcreate-large-raid.sh | 18 +++++++++---------
test/shell/lvcreate-raid-nosync.sh | 24 ++++++++++++------------
5 files changed, 49 insertions(+), 43 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 7dffdcb..3d84e86 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -1264,12 +1264,6 @@ wait_for_sync() {
return 1
}
-# aux check_status_chars $vg $lv "Aaaaa"
-check_status_chars() {
- [ `dmsetup status $1-$2|awk '{print $6}'` = $3 ] && return
- return 1
-}
-
# Check if tests are running on 64bit architecture
can_use_16T() {
test "$(getconf LONG_BIT)" -eq 64
diff --git a/test/lib/check.sh b/test/lib/check.sh
index e729ab2..f0e4f0b 100644
--- a/test/lib/check.sh
+++ b/test/lib/check.sh
@@ -392,6 +392,18 @@ sysfs() {
die "$1: $P = $val differs from expected value $3!"
}
+# check status_chars $vg $lv "Aaaaa"
+raid_leg_status() {
+ local st=$(dmsetup status $1-$2)
+ local val=$(echo "$st" | cut -d ' ' -f 6)
+ test "$val" = "$3"
+}
+
+raid_leg_status_is() {
+ raid_leg_status "$@" || \
+ die "Raid leg status $val differs from expected value $3 ($1-$2 $st)!"
+}
+
#set -x
unset LVM_VALGRIND
"$@"
diff --git a/test/shell/lvchange-rebuild-raid.sh b/test/shell/lvchange-rebuild-raid.sh
index e1eb6b4..e4c579e 100644
--- a/test/shell/lvchange-rebuild-raid.sh
+++ b/test/shell/lvchange-rebuild-raid.sh
@@ -35,33 +35,33 @@ aux wait_for_sync $vg $lv1
# Rebuild 1st and 2nd device would rebuild a
# whole mirror group and needs to be rejected.
not lvchange --yes --rebuild "$dev1" --rebuild "$dev2" $vg/$lv1
-not aux check_status_chars $vg $lv1 "aAaAAAAA"
+not check raid_leg_status $vg $lv1 "aAaAAAAA"
aux wait_for_sync $vg $lv1
# Rebuild 1st and 3nd device from different mirror groups is fine.
lvchange --yes --rebuild "$dev1" --rebuild "$dev3" $vg/$lv1
-aux check_status_chars $vg $lv1 "aAaAAAAA"
+check raid_leg_status_is $vg $lv1 "aAaAAAAA"
aux wait_for_sync $vg $lv1
# Rebuild devices 1, 3, 6 from different mirror groups is fine.
lvchange --yes --rebuild "$dev1" --rebuild "$dev3" --rebuild "$dev6" $vg/$lv1
-aux check_status_chars $vg $lv1 "aAaAAaAA"
+check raid_leg_status_is $vg $lv1 "aAaAAaAA"
aux wait_for_sync $vg $lv1
# 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 aux check_status_chars $vg $lv1 "aAaAaaAA"
+not check raid_leg_status $vg $lv1 "aAaAaaAA"
aux wait_for_sync $vg $lv1
# 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
-aux check_status_chars $vg $lv1 "aAaAaAaA"
+check raid_leg_status_is $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
-aux check_status_chars $vg $lv1 "AaAaAaAa"
+check raid_leg_status_is $vg $lv1 "AaAaAaAa"
aux wait_for_sync $vg $lv1
##############################################
@@ -73,23 +73,23 @@ aux wait_for_sync $vg $lv1
# 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 aux check_status_chars $vg $lv1 "aaaaaaaa"
+not check raid_leg_status $vg $lv1 "aaaaaaaa"
aux wait_for_sync $vg $lv1
# 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
-aux check_status_chars $vg $lv1 "Aaaaaaaa"
+check raid_leg_status_is $vg $lv1 "Aaaaaaaa"
aux wait_for_sync $vg $lv1
# Rebuilding the raid1 master leg is fine.
lvchange --yes --rebuild "$dev1" $vg/$lv1
-aux check_status_chars $vg $lv1 "aAAAAAAA"
+check raid_leg_status_is $vg $lv1 "aAAAAAAA"
aux wait_for_sync $vg $lv1
# Rebuild legs on devices 2, 4, 6 and 8 is fine.
lvchange --yes --rebuild "$dev2" --rebuild "$dev4" --rebuild "$dev6" --rebuild "$dev8" $vg/$lv1
-aux check_status_chars $vg $lv1 "AaAaAaAa"
+check raid_leg_status_is $vg $lv1 "AaAaAaAa"
aux wait_for_sync $vg $lv1
##############################################
@@ -101,28 +101,28 @@ aux wait_for_sync $vg $lv1
# 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 aux check_status_chars $vg $lv1 "aaaaaa"
+not check raid_leg_status $vg $lv1 "aaaaaa"
aux wait_for_sync $vg $lv1
# Rebuilding more than 2 raid6 stripes needs to be rejected.
not lvchange --yes --rebuild "$dev2" --rebuild "$dev4" --rebuild "$dev6" $vg/$lv1
-not aux check_status_chars $vg $lv1 "AaAaAa"
+not check raid_leg_status $vg $lv1 "AaAaAa"
aux wait_for_sync $vg $lv1
# Rebuilding any 1 raid6 stripe is fine.
lvchange --yes --rebuild "$dev2" $vg/$lv1
-aux check_status_chars $vg $lv1 "AaAAAA"
+check raid_leg_status_is $vg $lv1 "AaAAAA"
aux wait_for_sync $vg $lv1
lvchange --yes --rebuild "$dev5" $vg/$lv1
-aux check_status_chars $vg $lv1 "AAAAaA"
+check raid_leg_status_is $vg $lv1 "AAAAaA"
aux wait_for_sync $vg $lv1
# Rebuilding any 2 raid6 stripes is fine.
lvchange --yes --rebuild "$dev2" --rebuild "$dev4" $vg/$lv1
-aux check_status_chars $vg $lv1 "AaAaAA"
+check raid_leg_status_is $vg $lv1 "AaAaAA"
aux wait_for_sync $vg $lv1
lvchange --yes --rebuild "$dev1" --rebuild "$dev5" $vg/$lv1
-aux check_status_chars $vg $lv1 "aAAAaA"
+check raid_leg_status_is $vg $lv1 "aAAAaA"
aux wait_for_sync $vg $lv1
vgremove -ff $vg
diff --git a/test/shell/lvcreate-large-raid.sh b/test/shell/lvcreate-large-raid.sh
index c2e9b7e..d8d077c 100644
--- a/test/shell/lvcreate-large-raid.sh
+++ b/test/shell/lvcreate-large-raid.sh
@@ -43,20 +43,20 @@ done
# 200 TiB raid1
lvcreate --type raid1 -m 1 -L 200T -n $lv1 $vg1 --nosync
check lv_field $vg1/$lv1 size "200.00t"
-aux check_status_chars $vg1 $lv1 "AA"
+check raid_leg_status_is $vg1 $lv1 "AA"
lvremove -ff $vg1
# 1 PiB raid1
lvcreate --type raid1 -m 1 -L 1P -n $lv1 $vg1 --nosync
check lv_field $vg1/$lv1 size "1.00p"
-aux check_status_chars $vg1 $lv1 "AA"
+check raid_leg_status_is $vg1 $lv1 "AA"
lvremove -ff $vg1
# 750 TiB raid4/5
for segtype in raid4 raid5; do
lvcreate --type $segtype -i 3 -L 750T -n $lv1 $vg1 --nosync
check lv_field $vg1/$lv1 size "750.00t"
- aux check_status_chars $vg1 $lv1 "AAAA"
+ check raid_leg_status_is $vg1 $lv1 "AAAA"
lvremove -ff $vg1
done
@@ -65,10 +65,10 @@ done
#
lvcreate --type raid1 -m 1 -L 200T -n $lv1 $vg1 --nosync
check lv_field $vg1/$lv1 size "200.00t"
-aux check_status_chars $vg1 $lv1 "AA"
+check raid_leg_status_is $vg1 $lv1 "AA"
lvextend -L +200T $vg1/$lv1
check lv_field $vg1/$lv1 size "400.00t"
-aux check_status_chars $vg1 $lv1 "AA"
+check raid_leg_status_is $vg1 $lv1 "AA"
lvremove -ff $vg1
@@ -80,16 +80,16 @@ fi
# 750 TiB raid6
lvcreate --type raid6 -i 3 -L 750T -n $lv1 $vg1
check lv_field $vg1/$lv1 size "750.00t"
-aux check_status_chars $vg1 $lv1 "aaaaa"
+check raid_leg_status_is $vg1 $lv1 "aaaaa"
lvremove -ff $vg1
# 1 PiB raid6, then extend up to 2 PiB
lvcreate --type raid6 -i 3 -L 1P -n $lv1 $vg1
check lv_field $vg1/$lv1 size "1.00p"
-aux check_status_chars $vg1 $lv1 "aaaaa"
+check raid_leg_status_is $vg1 $lv1 "aaaaa"
lvextend -L +1P $vg1/$lv1
check lv_field $vg1/$lv1 size "2.00p"
-aux check_status_chars $vg1 $lv1 "aaaaa"
+check raid_leg_status_is $vg1 $lv1 "aaaaa"
lvremove -ff $vg1
#
@@ -98,7 +98,7 @@ lvremove -ff $vg1
lvcreate -aey -L 200T -n $lv1 $vg1
lvconvert --type raid1 -m 1 $vg1/$lv1
check lv_field $vg1/$lv1 size "200.00t"
-aux check_status_chars $vg1 $lv1 "aa"
+check raid_leg_status_is $vg1 $lv1 "aa"
lvremove -ff $vg1
# bz837927 END
diff --git a/test/shell/lvcreate-raid-nosync.sh b/test/shell/lvcreate-raid-nosync.sh
index 71eeefc..14ea8af 100644
--- a/test/shell/lvcreate-raid-nosync.sh
+++ b/test/shell/lvcreate-raid-nosync.sh
@@ -27,42 +27,42 @@ aux delay_dev "$dev1" 0 10 $(get first_extent_sector "$dev1")
for r in raid0 raid0_meta
do
lvcreate --yes --type raid0 -i 3 -l 1 -n $lv1 $vg
- aux check_status_chars $vg $lv1 "AAA"
+ check raid_leg_status_is $vg $lv1 "AAA"
lvremove --yes $vg/$lv1
done
# raid1 supports resynchronization
lvcreate --yes --type raid1 -m 2 -l 1 -n $lv1 $vg
-aux check_status_chars $vg $lv1 "aaa"
+check raid_leg_status_is $vg $lv1 "aaa"
aux wait_for_sync $vg $lv1
-aux check_status_chars $vg $lv1 "AAA"
+check raid_leg_status_is $vg $lv1 "AAA"
lvremove --yes $vg/$lv1
# raid1 supports --nosync
lvcreate --yes --type raid1 --nosync -m 2 -l 1 -n $lv1 $vg
-aux check_status_chars $vg $lv1 "AAA"
+check raid_leg_status_is $vg $lv1 "AAA"
lvremove --yes $vg/$lv1
for r in raid4 raid5
do
# raid4/5 support resynchronization
lvcreate --yes --type $r -i 3 -l 1 -n $lv1 $vg
- aux check_status_chars $vg $lv1 "aaaa"
+ check raid_leg_status_is $vg $lv1 "aaaa"
aux wait_for_sync $vg $lv1
- aux check_status_chars $vg $lv1 "AAAA"
+ check raid_leg_status_is $vg $lv1 "AAAA"
lvremove --yes $vg/$lv1
# raid4/5 support --nosync
lvcreate --yes --type $r --nosync -i 3 -l 1 -n $lv1 $vg
- aux check_status_chars $vg $lv1 "AAAA"
+ check raid_leg_status_is $vg $lv1 "AAAA"
lvremove --yes $vg/$lv1
done
# raid6 supports resynchronization
lvcreate --yes --type raid6 -i 3 -l 1 -n $lv1 $vg
-aux check_status_chars $vg $lv1 "aaaaa"
+check raid_leg_status_is $vg $lv1 "aaaaa"
aux wait_for_sync $vg $lv1
-aux check_status_chars $vg $lv1 "AAAAA"
+check raid_leg_status_is $vg $lv1 "AAAAA"
lvremove --yes $vg/$lv1
# raid6 rejects --nosync; it has to initialize P- and Q-Syndromes
@@ -70,15 +70,15 @@ not lvcreate --yes --type raid6 --nosync -i 3 -l 1 -n $lv1 $vg
# raid10 supports resynchronization
lvcreate --yes --type raid10 -m 1 -i 3 -l 1 -n $lv1 $vg
-aux check_status_chars $vg $lv1 "aaaaaa"
+check raid_leg_status_is $vg $lv1 "aaaaaa"
aux wait_for_sync $vg $lv1
-aux check_status_chars $vg $lv1 "AAAAAA"
+check raid_leg_status_is $vg $lv1 "AAAAAA"
aux wait_for_sync $vg $lv1
lvremove --yes $vg/$lv1
# raid10 supports --nosync
lvcreate --yes --type raid10 --nosync -m 1 -i 3 -l 1 -n $lv1 $vg
-aux check_status_chars $vg $lv1 "AAAAAA"
+check raid_leg_status_is $vg $lv1 "AAAAAA"
aux wait_for_sync $vg $lv1
lvremove --yes $vg/$lv1
6 years, 8 months