stable-2.02 - pvmove_poll: instrument
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=fdb014f02fe67d3a845...
Commit: fdb014f02fe67d3a8455c919516e752ec07e9b04
Parent: 4a3e1ac7407dff9e53c5efea179a5620ad13f8f3
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Tue Jul 16 14:28:19 2019 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Wed Aug 14 21:40:26 2019 +0200
pvmove_poll: instrument
---
tools/pvmove_poll.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/tools/pvmove_poll.c b/tools/pvmove_poll.c
index e50747c..23adf17 100644
--- a/tools/pvmove_poll.c
+++ b/tools/pvmove_poll.c
@@ -78,21 +78,28 @@ int pvmove_update_metadata(struct cmd_context *cmd, struct volume_group *vg,
struct dm_list *lvs_changed __attribute__((unused)),
unsigned flags __attribute__((unused)))
{
+printf("%s[%u] lv_mirr->read_ahead=%d\n", __func__, __LINE__, lv_mirr->read_ahead);
if (!lv_update_and_reload(lv_mirr))
return_0;
+printf("%s[%u] lv_mirr->read_ahead=%d\n", __func__, __LINE__, lv_mirr->read_ahead);
return 1;
}
int pvmove_finish(struct cmd_context *cmd, struct volume_group *vg,
struct logical_volume *lv_mirr, struct dm_list *lvs_changed)
{
+ int read_ahead = lv_mirr->read_ahead;
+
+printf("%s[%u] lv_mirr->read_ahead=%d\n", __func__, __LINE__, lv_mirr->read_ahead);
if (!dm_list_empty(lvs_changed) &&
(!_detach_pvmove_mirror(cmd, lv_mirr) ||
!replace_lv_with_error_segment(lv_mirr))) {
log_error("ABORTING: Removal of temporary mirror failed");
return 0;
}
+ lv_mirr->read_ahead = read_ahead;
+printf("%s[%u] lv_mirr->read_ahead=%d\n", __func__, __LINE__, lv_mirr->read_ahead);
if (!lv_update_and_reload(lv_mirr))
return_0;
4 years, 8 months
stable-2.02 - dmeventd: avoid bail out preventing repair in raid plugin
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=9e438b4bc6b9240b63f...
Commit: 9e438b4bc6b9240b63fc79acfef3c77c01a848d8
Parent: fdb014f02fe67d3a8455c919516e752ec07e9b04
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Fri Aug 16 16:25:08 2019 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Fri Aug 16 18:08:22 2019 +0200
dmeventd: avoid bail out preventing repair in raid plugin
Problem:
even though dead raid component devices are detected, the
raid plugin is bailing out thus preventing a repair attempt.
Rational:
in case of component device errors, the MD resynchronization
thread runs in parallel with the thrown event being processed
by the raid plugin. The plugin retrieves the raid device status
but that still reflects insync regions as 0 (when it should
already be total regions) because the MD thread didn't update it yet.
Solution:
Remove the insync regions check and let lvconvert carry out its
pre-repair checks and optionally carry out a repair attempt.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1560739
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1468590
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1654860
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1729303
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1741016
---
daemons/dmeventd/plugins/raid/dmeventd_raid.c | 16 ++++++----------
1 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/daemons/dmeventd/plugins/raid/dmeventd_raid.c b/daemons/dmeventd/plugins/raid/dmeventd_raid.c
index 52cf43d..f435043 100644
--- a/daemons/dmeventd/plugins/raid/dmeventd_raid.c
+++ b/daemons/dmeventd/plugins/raid/dmeventd_raid.c
@@ -76,16 +76,12 @@ static int _process_raid_event(struct dso_state *state, char *params, const char
}
if (dead) {
- if (status->insync_regions < status->total_regions) {
- if (!state->warned) {
- state->warned = 1;
- log_warn("WARNING: waiting for resynchronization to finish "
- "before initiating repair on RAID device %s.", device);
- }
-
- goto out; /* Not yet done syncing with accessible devices */
- }
-
+ /*
+ * Use the first event to run a repair ignoring any additonal ones.
+ *
+ * We presume lvconvert to do pre-repair
+ * checks to avoid bloat in this plugin.
+ */
if (state->failed)
goto out; /* already reported */
4 years, 8 months
master - dmeventd: avoid bail out preventing repair in raid plugin
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=ad560a286a0b5d08086...
Commit: ad560a286a0b5d08086324e6194b060c136e9353
Parent: 125f27ac37bc9b93cc96f64052b9681b3d479ee1
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Fri Aug 16 16:25:08 2019 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Fri Aug 16 18:07:03 2019 +0200
dmeventd: avoid bail out preventing repair in raid plugin
Problem:
even though dead raid component devices are detected, the
raid plugin is bailing out thus preventing a repair attempt.
Rational:
in case of component device errors, the MD resynchronization
thread runs in parallel with the thrown event being processed
by the raid plugin. The plugin retrieves the raid device status
but that still reflects insync regions as 0 (when it should
already be total regions) because the MD thread didn't update it yet.
Solution:
Remove the insync regions check and let lvconvert carry out its
pre-repair checks and optionally carry out a repair attempt.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1560739
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1468590
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1654860
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1729303
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1741016
---
daemons/dmeventd/plugins/raid/dmeventd_raid.c | 16 ++++++----------
1 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/daemons/dmeventd/plugins/raid/dmeventd_raid.c b/daemons/dmeventd/plugins/raid/dmeventd_raid.c
index aa2b578..3431f1e 100644
--- a/daemons/dmeventd/plugins/raid/dmeventd_raid.c
+++ b/daemons/dmeventd/plugins/raid/dmeventd_raid.c
@@ -76,16 +76,12 @@ static int _process_raid_event(struct dso_state *state, char *params, const char
}
if (dead) {
- if (status->insync_regions < status->total_regions) {
- if (!state->warned) {
- state->warned = 1;
- log_warn("WARNING: waiting for resynchronization to finish "
- "before initiating repair on RAID device %s.", device);
- }
-
- goto out; /* Not yet done syncing with accessible devices */
- }
-
+ /*
+ * Use the first event to run a repair ignoring any additonal ones.
+ *
+ * We presume lvconvert to do pre-repair
+ * checks to avoid bloat in this plugin.
+ */
if (state->failed)
goto out; /* already reported */
4 years, 8 months
master - udev: remove unsupported OPTIONS+="event_timeout" rule
by Peter Rajnoha
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=125f27ac37bc9b93cc9...
Commit: 125f27ac37bc9b93cc96f64052b9681b3d479ee1
Parent: e653f43732fd61f8dc272b157f323663abce3daa
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Tue Aug 13 15:18:30 2019 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Tue Aug 13 15:18:30 2019 +0200
udev: remove unsupported OPTIONS+="event_timeout" rule
The OPTIONS+="event_timeout" is Unsupported since systemd/udev version 216,
that is ~5 years ago.
Since systemd/udev version 243, there's a new message printed if unsupported
OPTIONS value is used:
Invalid value for OPTIONS key, ignoring: 'event_timeout=180'
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1740666
---
WHATS_NEW | 1 +
udev/11-dm-lvm.rules.in | 2 --
2 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index a7ccd39..63c3c27 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.03.06 -
================================
+ Remove unsupported OPTIONS+="event_timeout" udev rule from 11-dm-lvm.rules.
Prevent creating VGs with PVs with different logical block sizes.
Fix metadata writes from corrupting with large physical block size.
diff --git a/udev/11-dm-lvm.rules.in b/udev/11-dm-lvm.rules.in
index 91cb991..7c58994 100644
--- a/udev/11-dm-lvm.rules.in
+++ b/udev/11-dm-lvm.rules.in
@@ -37,8 +37,6 @@ ENV{DM_SUBSYSTEM_UDEV_FLAG0}!="1", ENV{DM_NOSCAN}=="1", ENV{DM_UDEV_DISABLE_OTHE
ENV{DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG}=="1", GOTO="lvm_end"
-OPTIONS+="event_timeout=180"
-
# Do not create symlinks for inappropriate subdevices.
ENV{DM_LV_NAME}=="pvmove?*|?*_vorigin", GOTO="lvm_disable"
ENV{DM_LV_LAYER}=="?*", GOTO="lvm_disable"
4 years, 8 months
master - tests: simplify some var settings
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=e653f43732fd61f8dc2...
Commit: e653f43732fd61f8dc272b157f323663abce3daa
Parent: 05c7e09e7100292cbdf713256ceec76b53ddd57d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Jun 20 00:03:18 2019 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Aug 9 12:57:21 2019 +0200
tests: simplify some var settings
scan_lvs now automatically comes with extend_filter_LVMTEST
---
test/lib/aux.sh | 2 +-
test/shell/discards-thin.sh | 2 --
test/shell/lvconvert-thin.sh | 2 --
test/shell/lvcreate-large-raid10.sh | 1 -
test/shell/lvcreate-large.sh | 2 --
test/shell/pvcreate-operation-md.sh | 3 +--
test/shell/pvcreate-restore.sh | 2 --
test/shell/pvremove-thin.sh | 2 --
test/shell/scan-lvs.sh | 4 +---
test/shell/snapshot-remove-dmsetup.sh | 2 --
test/shell/snapshot-usage-exa.sh | 2 --
test/shell/snapshot-usage.sh | 2 --
test/shell/vgsplit-stacked.sh | 2 --
13 files changed, 3 insertions(+), 25 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 81e8f91..32d5a0b 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -1164,7 +1164,7 @@ devices/default_data_alignment = 1
devices/dir = "$DM_DEV_DIR"
devices/filter = "a|.*|"
devices/global_filter = [ "a|$DM_DEV_DIR/mapper/${PREFIX}.*pv[0-9_]*$|", "r|.*|" ]
-devices/md_component_detection = 0
+devices/md_component_detection = 0
devices/scan = "$DM_DEV_DIR"
devices/sysfs_scan = 1
devices/write_cache_state = 0
diff --git a/test/shell/discards-thin.sh b/test/shell/discards-thin.sh
index 3564a87..f27d4c3 100644
--- a/test/shell/discards-thin.sh
+++ b/test/shell/discards-thin.sh
@@ -25,8 +25,6 @@ export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false}
#
aux have_thin 1 1 0 || skip
-aux lvmconf 'devices/scan_lvs = 1'
-
aux prepare_vg 2 64
get_devs
diff --git a/test/shell/lvconvert-thin.sh b/test/shell/lvconvert-thin.sh
index 731c45b..1f8d2ed 100644
--- a/test/shell/lvconvert-thin.sh
+++ b/test/shell/lvconvert-thin.sh
@@ -17,8 +17,6 @@ export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false}
. lib/inittest
-aux lvmconf 'devices/scan_lvs = 1'
-
prepare_lvs() {
lvremove -f $vg
lvcreate -L10M -n $lv1 $vg
diff --git a/test/shell/lvcreate-large-raid10.sh b/test/shell/lvcreate-large-raid10.sh
index 1ad09aa..a46be37 100644
--- a/test/shell/lvcreate-large-raid10.sh
+++ b/test/shell/lvcreate-large-raid10.sh
@@ -20,7 +20,6 @@ SKIP_WITH_LVMPOLLD=1
# FIXME update test to make something useful on <16T
aux can_use_16T || skip
aux have_raid 1 3 0 || skip
-aux lvmconf 'devices/scan_lvs = 1'
aux prepare_vg 5
diff --git a/test/shell/lvcreate-large.sh b/test/shell/lvcreate-large.sh
index b1cb0b0..473b0ed 100644
--- a/test/shell/lvcreate-large.sh
+++ b/test/shell/lvcreate-large.sh
@@ -17,8 +17,6 @@ SKIP_WITH_LVMPOLLD=1
. lib/inittest
-aux lvmconf 'devices/scan_lvs = 1'
-
# FIXME update test to make something useful on <16T
aux can_use_16T || skip
diff --git a/test/shell/pvcreate-operation-md.sh b/test/shell/pvcreate-operation-md.sh
index 11f0887..4b51932 100644
--- a/test/shell/pvcreate-operation-md.sh
+++ b/test/shell/pvcreate-operation-md.sh
@@ -22,8 +22,7 @@ test -f /proc/mdstat && grep -q raid0 /proc/mdstat || \
modprobe raid0 || skip
aux lvmconf 'devices/md_component_detection = 1'
-aux extend_filter_LVMTEST
-aux extend_filter "a|/dev/md.*|"
+aux extend_filter_LVMTEST "a|/dev/md|"
aux prepare_devs 2
diff --git a/test/shell/pvcreate-restore.sh b/test/shell/pvcreate-restore.sh
index 789f45c..d0b46eb 100644
--- a/test/shell/pvcreate-restore.sh
+++ b/test/shell/pvcreate-restore.sh
@@ -15,8 +15,6 @@ SKIP_WITH_LVMPOLLD=1
. lib/inittest
-aux lvmconf 'devices/scan_lvs = 1'
-
aux prepare_vg 4
lvcreate --type snapshot -s -L10 -n $lv1 $vg --virtualsize 2T
diff --git a/test/shell/pvremove-thin.sh b/test/shell/pvremove-thin.sh
index 84a2a55..9859b6c 100644
--- a/test/shell/pvremove-thin.sh
+++ b/test/shell/pvremove-thin.sh
@@ -18,8 +18,6 @@ SKIP_WITH_LVMPOLLD=1
. lib/inittest
-aux lvmconf 'devices/scan_lvs = 1'
-
aux prepare_vg
aux have_thin 1 8 0 || skip
diff --git a/test/shell/scan-lvs.sh b/test/shell/scan-lvs.sh
index 8e8a77d..f49bf4d 100644
--- a/test/shell/scan-lvs.sh
+++ b/test/shell/scan-lvs.sh
@@ -15,10 +15,9 @@ SKIP_WITH_LVMPOLLD=1
. lib/inittest
+# Sets 'scan_lvs = 1'
aux extend_filter_LVMTEST
-aux lvmconf 'devices/scan_lvs = 1'
-
aux prepare_pvs 1
vgcreate $SHARED $vg1 "$dev1"
@@ -44,4 +43,3 @@ lvchange -an "$vg1/$lv1"
lvremove "$vg1/$lv1"
vgremove $vg1
-
diff --git a/test/shell/snapshot-remove-dmsetup.sh b/test/shell/snapshot-remove-dmsetup.sh
index 916aec9..19411ce 100644
--- a/test/shell/snapshot-remove-dmsetup.sh
+++ b/test/shell/snapshot-remove-dmsetup.sh
@@ -17,8 +17,6 @@ SKIP_WITH_LVMPOLLD=1
. lib/inittest
-aux lvmconf 'devices/scan_lvs = 1'
-
which mkfs.ext2 || skip
aux prepare_vg 5
diff --git a/test/shell/snapshot-usage-exa.sh b/test/shell/snapshot-usage-exa.sh
index f537f0d..5d666bf 100644
--- a/test/shell/snapshot-usage-exa.sh
+++ b/test/shell/snapshot-usage-exa.sh
@@ -18,8 +18,6 @@ SKIP_WITH_LVMPOLLD=1
. lib/inittest
-aux lvmconf 'devices/scan_lvs = 1'
-
aux can_use_16T || skip
aux prepare_pvs 1
diff --git a/test/shell/snapshot-usage.sh b/test/shell/snapshot-usage.sh
index 5cfdae6..bcfa16a 100644
--- a/test/shell/snapshot-usage.sh
+++ b/test/shell/snapshot-usage.sh
@@ -17,8 +17,6 @@ SKIP_WITH_LVMPOLLD=1
. lib/inittest
-aux lvmconf 'devices/scan_lvs = 1'
-
MKFS=mkfs.ext2
which $MKFS || skip
diff --git a/test/shell/vgsplit-stacked.sh b/test/shell/vgsplit-stacked.sh
index 09af3f7..331ee8e 100644
--- a/test/shell/vgsplit-stacked.sh
+++ b/test/shell/vgsplit-stacked.sh
@@ -15,8 +15,6 @@ SKIP_WITH_LVMPOLLD=1
. lib/inittest
-aux lvmconf 'devices/scan_lvs = 1'
-
aux extend_filter_LVMTEST
aux prepare_pvs 3
4 years, 8 months
master - tests: for cluster testing we always need exclusive mirrors
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=05c7e09e7100292cbdf...
Commit: 05c7e09e7100292cbdf713256ceec76b53ddd57d
Parent: 505c1d56e8d48a479ef95c7890d3c9e066b66f33
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Jun 20 11:07:43 2019 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Aug 9 12:57:21 2019 +0200
tests: for cluster testing we always need exclusive mirrors
Cluster test would fail without exlusively activated mirror.
FIXME: test is still broken, since LV2 is not active after split.
---
test/shell/lvconvert-mirror-split.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/shell/lvconvert-mirror-split.sh b/test/shell/lvconvert-mirror-split.sh
index 40720a4..00291ec 100644
--- a/test/shell/lvconvert-mirror-split.sh
+++ b/test/shell/lvconvert-mirror-split.sh
@@ -20,7 +20,7 @@ aux prepare_vg 3
# Mirror split tests
###########################################
# 3-way to 2-way/linear
-lvcreate --type mirror -m 2 -l 2 -n $lv1 $vg
+lvcreate -aey --type mirror -m 2 -l 2 -n $lv1 $vg
aux wait_for_sync $vg $lv1
lvconvert --splitmirrors 1 -n $lv2 -vvvv $vg/$lv1
4 years, 8 months
master - tests: accept also value 512
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=505c1d56e8d48a479ef...
Commit: 505c1d56e8d48a479ef95c7890d3c9e066b66f33
Parent: 1e553159d5147c601ae4b524198461309016b496
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Jun 20 14:20:35 2019 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Aug 9 12:57:21 2019 +0200
tests: accept also value 512
Older kernels provide fixed value 512 instead of 0.
---
test/shell/lvchange-cache.sh | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/test/shell/lvchange-cache.sh b/test/shell/lvchange-cache.sh
index ab7c8b0..93c8c3b 100644
--- a/test/shell/lvchange-cache.sh
+++ b/test/shell/lvchange-cache.sh
@@ -88,7 +88,8 @@ grep 'random_threshold=4' out
else
# When MQ is emulated by SMQ policy it does not hold settings.
# So just skip testing of param changes when sequential_threshold=0
-grep 'sequential_threshold=0' out
+# or some older kernel instancies show also value 512
+grep 'sequential_threshold=0' out || grep 'sequential_threshold=512' out
fi
fi # have_cache 1 5 0
4 years, 8 months
master - tests: add settle wait before issue remove
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=1e553159d5147c601ae...
Commit: 1e553159d5147c601ae4b524198461309016b496
Parent: d3903d94e910b7ca673ef090c6fe9f79b04b7dd5
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Jul 4 16:58:27 2019 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Aug 9 12:57:21 2019 +0200
tests: add settle wait before issue remove
Some older BB with older cryptsetup tool do not 'retry' on remove
and when remove is issued right after 'fsck' - it might be
rejected with:
Device @PREFIX@-tcrypt2 is busy.
Try to use udevadm settle.
---
test/shell/fsadm-crypt.sh | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/test/shell/fsadm-crypt.sh b/test/shell/fsadm-crypt.sh
index 9377e89..4b8fc4e 100644
--- a/test/shell/fsadm-crypt.sh
+++ b/test/shell/fsadm-crypt.sh
@@ -83,6 +83,7 @@ export LVM_BINARY
test ! -d "$mount_dir" && mkdir "$mount_dir"
crypt_close() {
+ aux udev_wait
cryptsetup remove "$1"
if [ "$?" -eq 0 -a -n "$DROP_SYMLINK" ]; then
rm -f "$DM_DEV_DIR/mapper/$1"
4 years, 8 months
master - tests: fix ra checking
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=d3903d94e910b7ca673...
Commit: d3903d94e910b7ca673ef090c6fe9f79b04b7dd5
Parent: 3596210e02452f3785f0639115f6744f8f7e2dfc
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Jun 18 13:20:27 2019 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Aug 9 12:57:21 2019 +0200
tests: fix ra checking
Since with some installed package like 'tuned' the value of 'RA' on
PV origin device can be different, adapting tests to count with this.
---
test/shell/lvcreate-usage.sh | 14 ++++++++++----
test/shell/read-ahead.sh | 6 +++++-
2 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/test/shell/lvcreate-usage.sh b/test/shell/lvcreate-usage.sh
index 6d42401..ca8694e 100644
--- a/test/shell/lvcreate-usage.sh
+++ b/test/shell/lvcreate-usage.sh
@@ -175,15 +175,21 @@ check lv_field $vg/$lv2 lv_kernel_read_ahead "0"
lvcreate -L 8 -n $lv3 --readahead 8k $vg
check lv_field $vg/$lv3 lv_read_ahead "8.00k"
check lv_field $vg/$lv3 lv_kernel_read_ahead "8.00k"
-lvcreate -L 8 -n $lv4 --readahead auto $vg
+lvcreate -L 8 -n $lv4 --readahead auto $vg "$dev1"
check lv_field $vg/$lv4 lv_read_ahead "auto"
-check lv_field $vg/$lv4 lv_kernel_read_ahead "128.00k"
+# figure RA value of a PV origin device
+DEVICE=$(dmsetup deps -o blkdevname "$dev1" | sed -e "s,.*:\ (\(.*\)),/dev/\1,")
+RASZ=$(( $(blockdev --getra "$DEVICE" ) / 2 ))
+SZ="$RASZ.00k"
+test "$RASZ" -ge 128 || SZ="128.00k"
+check lv_field $vg/$lv4 lv_kernel_read_ahead "$SZ" --units k
lvcreate -L 8 -n $lv5 -i2 --stripesize 16k --readahead auto $vg
check lv_field $vg/$lv5 lv_read_ahead "auto"
-check lv_field $vg/$lv5 lv_kernel_read_ahead "128.00k"
+check lv_field $vg/$lv5 lv_kernel_read_ahead "$SZ" --units k
lvcreate -L 8 -n $lv6 -i2 --stripesize 128k --readahead auto $vg
check lv_field $vg/$lv6 lv_read_ahead "auto"
-check lv_field $vg/$lv6 lv_kernel_read_ahead "512.00k"
+test "$RASZ" -ge 512 || SZ="512.00k"
+check lv_field $vg/$lv6 lv_kernel_read_ahead "$SZ" --units k
lvremove -ff $vg
#
diff --git a/test/shell/read-ahead.sh b/test/shell/read-ahead.sh
index 60e5912..53cc572 100644
--- a/test/shell/read-ahead.sh
+++ b/test/shell/read-ahead.sh
@@ -35,8 +35,12 @@ lvremove -ff $vg
#COMM "read ahead is properly inherited from underlying PV"
blockdev --setra 768 "$dev1"
vgscan
+DEVICE=$(dmsetup deps -o blkdevname "$dev1" | sed -e "s,.*:\ (\(.*\)),/dev/\1,")
+RASZ=$(blockdev --getra "$DEVICE")
+SZ=$RASZ
+test "$RASZ" -ge 768 || SZ=768
lvcreate -n $lv -L4m $vg "$dev1"
-test "$(blockdev --getra "$DM_DEV_DIR/$vg/$lv")" -eq 768
+test "$(blockdev --getra "$DM_DEV_DIR/$vg/$lv")" -eq "$SZ"
lvremove -ff $vg
# Check default, active/inactive values for read_ahead / kernel_read_ahead
4 years, 8 months
master - tests: replaces grep -q usage
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=3596210e02452f3785f...
Commit: 3596210e02452f3785f0639115f6744f8f7e2dfc
Parent: 08396b4bce45fb8311979250623f04ec0ddb628c
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jun 17 22:47:35 2019 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Aug 9 12:57:21 2019 +0200
tests: replaces grep -q usage
Since we use 'set -euE -o pipefail' for shell execution,
any failure of any command in the 'piped' shell can result
in failure of whole executed chain - resulting in typically
unsually test skip, that was left unnoticed.
Since checked command have usually short output, the simplest
fix seems to be to let grep parse whole output instead
of quiting after first match.
---
test/lib/aux.sh | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index e3f624c..81e8f91 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -26,7 +26,7 @@ expect_failure() {
check_daemon_in_builddir() {
# skip if we don't have our own deamon...
if test -z "${installed_testsuite+varset}"; then
- (which "$1" 2>/dev/null | grep -q "$abs_builddir") || skip "$1 is not in executed path."
+ (which "$1" 2>/dev/null | grep "$abs_builddir" >/dev/null ) || skip "$1 is not in executed path."
fi
rm -f debug.log strace.log
}
@@ -167,7 +167,7 @@ prepare_clvmd() {
test -e "$DM_DEV_DIR/control" || dmsetup table >/dev/null # create control node
# skip if singlenode is not compiled in
- (clvmd --help 2>&1 | grep "Available cluster managers" | grep -q "singlenode") || \
+ (clvmd --help 2>&1 | grep "Available cluster managers" | grep "singlenode" >/dev/null) || \
skip "Compiled clvmd does not support singlenode for testing."
# lvmconf "activation/monitoring = 1"
@@ -531,7 +531,7 @@ teardown() {
dm_table | not grep -E -q "$vg|$vg1|$vg2|$vg3|$vg4" || {
# Avoid activation of dmeventd if there is no pid
cfg=$(test -s LOCAL_DMEVENTD || echo "--config activation{monitoring=0}")
- if dm_info suspended,name | grep -q "^Suspended:.*$PREFIX" ; then
+ if dm_info suspended,name | grep "^Suspended:.*$PREFIX" >/dev/null ; then
echo "## skipping vgremove, suspended devices detected."
else
vgremove -ff "$cfg" \
@@ -662,7 +662,7 @@ prepare_scsi_debug_dev() {
# Skip test if scsi_debug module is unavailable or is already in use
modprobe --dry-run scsi_debug || skip
- lsmod | not grep -q scsi_debug || skip
+ lsmod | not grep scsi_debug >/dev/null || skip
# Create the scsi_debug device and determine the new scsi device's name
# NOTE: it will _never_ make sense to pass num_tgts param;
@@ -1447,7 +1447,7 @@ driver_at_least() {
}
have_thin() {
- lvm segtypes 2>/dev/null | grep -q thin$ || {
+ lvm segtypes 2>/dev/null | grep thin$ >/dev/null || {
echo "Thin is not built-in." >&2
return 1
}
@@ -1471,7 +1471,7 @@ have_thin() {
}
have_vdo() {
- lvm segtypes 2>/dev/null | grep -q vdo$ || {
+ lvm segtypes 2>/dev/null | grep vdo$ >/dev/null || {
echo "VDO is not built-in." >&2
return 1
}
@@ -1507,7 +1507,7 @@ have_raid4 () {
}
have_cache() {
- lvm segtypes 2>/dev/null | grep -q cache$ || {
+ lvm segtypes 2>/dev/null | grep cache$ >/dev/null || {
echo "Cache is not built-in." >&2
return 1
}
4 years, 8 months