master - vgchange: don't fail monitor command if vg is exported
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=82b137ef2f7f1b6fc1b...
Commit: 82b137ef2f7f1b6fc1bbf83918750037835a9568
Parent: 556dcd2c6b82ead3a5aa50211f08f9d69be13fe1
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu Jun 20 15:59:36 2019 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Jun 20 15:59:36 2019 -0500
vgchange: don't fail monitor command if vg is exported
When monitoring, skip exported VGs without causing a command
failure.
The lvm2-monitor service runs 'vgchange --monitor y', so
any exported VG on the system would cause the service to
fail.
---
tools/vgchange.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/tools/vgchange.c b/tools/vgchange.c
index d6d4f91..a17f456 100644
--- a/tools/vgchange.c
+++ b/tools/vgchange.c
@@ -631,6 +631,8 @@ static int _vgchange_single(struct cmd_context *cmd, const char *vg_name,
};
if (vg_is_exported(vg)) {
+ if (cmd->command->command_enum == vgchange_monitor_CMD)
+ return ECMD_PROCESSED;
log_error("Volume group \"%s\" is exported", vg_name);
return ECMD_FAILED;
}
4 years, 10 months
stable-2.02 - tests: properly enforce v1
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=e0a176f49ab09d2afae...
Commit: e0a176f49ab09d2afaea73cafa4d7b41ade0c345
Parent: 24186cd9ce2d24616da7aba56787bc97acb2e42a
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Oct 16 21:32:28 2018 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jun 20 11:21:59 2019 +0200
tests: properly enforce v1
Since with smq policy we can still pick format v2 - enforce
format v1 explicitely.
---
test/shell/lvcreate-cache-no-tools.sh | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/shell/lvcreate-cache-no-tools.sh b/test/shell/lvcreate-cache-no-tools.sh
index e7d947a..bbab0fe 100644
--- a/test/shell/lvcreate-cache-no-tools.sh
+++ b/test/shell/lvcreate-cache-no-tools.sh
@@ -93,9 +93,9 @@ lvremove -f $vg
fi
+# Enforce older cache target format V1
+aux lvmconf 'allocation/cache_metadata_format = 1'
-# On older cache target that supports only V1 format
-aux lvmconf 'global/cache_disabled_features = [ "policy_smq" ]'
rm -f fake-tool.sh
lvcreate -aey -l1 -n $lv1 $vg
4 years, 10 months
stable-2.02 - tests: drop unwanted backup
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=24186cd9ce2d24616da...
Commit: 24186cd9ce2d24616da7aba56787bc97acb2e42a
Parent: 2806e6265f58308697d183a4d99967604663b734
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Nov 12 17:57:40 2018 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jun 20 11:21:59 2019 +0200
tests: drop unwanted backup
---
test/shell/lvcreate-cache-no-tools.sh | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/test/shell/lvcreate-cache-no-tools.sh b/test/shell/lvcreate-cache-no-tools.sh
index 23528e4..e7d947a 100644
--- a/test/shell/lvcreate-cache-no-tools.sh
+++ b/test/shell/lvcreate-cache-no-tools.sh
@@ -76,7 +76,6 @@ lvcreate -aey -l1 -n $lv1 $vg
lvcreate -H -l2 $vg/$lv1
check_change_ "Check is skipped"
-vgcfgbackup -f /dev/shm/back
# prepare fake version of cache_check tool that reports old version
make_fake_ "0.1.0"
4 years, 10 months
stable-2.02 - tests: for cluster testing we always need exclusive mirrors
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=2806e6265f58308697d...
Commit: 2806e6265f58308697d183a4d99967604663b734
Parent: 02a5921cdb90c15c93486ef8b8bd42486f6829b6
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Jun 20 11:07:43 2019 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jun 20 11:21:59 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, 10 months
stable-2.02 - tests: check for installed time command
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=02a5921cdb90c15c934...
Commit: 02a5921cdb90c15c93486ef8b8bd42486f6829b6
Parent: b61c89b52b524b59a515123a9d659066cc4e183e
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Jun 20 11:04:23 2019 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jun 20 11:21:08 2019 +0200
tests: check for installed time command
If the /usr/bin/time command is not installed, skip test
(do not want to use shells' built-in).
---
test/shell/thin-many-dmeventd.sh | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/test/shell/thin-many-dmeventd.sh b/test/shell/thin-many-dmeventd.sh
index f73b516..2a1fe74 100644
--- a/test/shell/thin-many-dmeventd.sh
+++ b/test/shell/thin-many-dmeventd.sh
@@ -22,6 +22,7 @@ export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false}
#
# Main
#
+TIME=$(which time) || skip "Missing 'time' command"
aux have_thin 1 0 0 || skip
aux prepare_dmeventd
@@ -54,7 +55,7 @@ sleep 9
# new thin-pool registration.
for i in $(seq 11 15)
do
- /usr/bin/time -o TM -f %e lvcreate --errorwhenfull y -Zn -T -L4M -V4M $vg/pool_${i} -n $lv${i}
+ "$TIME" -o TM -f %e lvcreate --errorwhenfull y -Zn -T -L4M -V4M $vg/pool_${i} -n $lv${i}
read -r t < TM
test ${t%%.*} -lt 8 || die "Creation of thin pool took more then 8 second! ($t seconds)"
# Fill thin-pool to some capacity >50%
4 years, 10 months
stable-2.02 - tests: update resize value
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b61c89b52b524b59a51...
Commit: b61c89b52b524b59a515123a9d659066cc4e183e
Parent: 78c937552a60e8e61cb9f1aca22095f28a39c174
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Apr 17 16:14:59 2019 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jun 20 10:55:55 2019 +0200
tests: update resize value
Since we now properly extend also _pmspare - there was not enough free
space to add 8extents to both volumes.
---
test/shell/relative-sign-options.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/shell/relative-sign-options.sh b/test/shell/relative-sign-options.sh
index 82a5ed2..dbf1644 100644
--- a/test/shell/relative-sign-options.sh
+++ b/test/shell/relative-sign-options.sh
@@ -77,7 +77,7 @@ lvresize --poolmetadatasize 64 $vg/$lv7
lvresize --poolmetadatasize +8 $vg/$lv7
not lvresize -y --poolmetadatasize -8 $vg/$lv7
-lvextend --poolmetadatasize +8 $vg/$lv7
+lvextend --poolmetadatasize +4 $vg/$lv7
not lvextend -y --poolmetadatasize -8 $vg/$lv7
fi
4 years, 10 months
stable-2.02 - tests: simplify some var settings
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=78c937552a60e8e61cb...
Commit: 78c937552a60e8e61cb9f1aca22095f28a39c174
Parent: a311684c4ab0ec2cf3a3d11412295da52df63c88
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Jun 20 00:03:18 2019 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jun 20 00:05:46 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 1db6fbf..804200d 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -1246,7 +1246,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 a234e5a..a7925d5 100644
--- a/test/shell/snapshot-remove-dmsetup.sh
+++ b/test/shell/snapshot-remove-dmsetup.sh
@@ -19,8 +19,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, 10 months
stable-2.02 - aux: fix selecting lvmconf values
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a311684c4ab0ec2cf3a...
Commit: a311684c4ab0ec2cf3a3d11412295da52df63c88
Parent: f3a87a2c2e339328ea4d7448f43d5317806a6b24
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Jun 19 23:55:44 2019 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jun 20 00:05:46 2019 +0200
aux: fix selecting lvmconf values
For older bashes (i.e. rhel5) code can't use internal bash arrays
and uses old-school greps and sorts to create configuration file.
But the split of value was mismatching names with same prefix
so i.e.
devices/scan
devices/scan_lvs
was matching always the later one - fix this by expecting
whitespace or '=' after the name.
---
test/lib/aux.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 86ed554..1db6fbf 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -1296,7 +1296,7 @@ EOF
echo "$s {"
local k
for k in $(grep ^"$s"/ "$config_values" | cut -f1 -d= | sed -e 's, *$,,' | sort | uniq); do
- grep "^$k" "$config_values" | tail -n 1 | sed -e "s,^$s/, ," || true
+ grep "^$k[ =]" "$config_values" | tail -n 1 | sed -e "s,^$s/, ," || true
done
echo "}"
echo
4 years, 10 months
stable-2.02 - Revert "lvconvert: disable linear to mirror of active LV in cluster VG"
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=f3a87a2c2e339328ea4...
Commit: f3a87a2c2e339328ea4d7448f43d5317806a6b24
Parent: 1727df7c98b749be90a5790d3d9858a012f687f6
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Jun 19 10:40:37 2019 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Jun 19 10:40:37 2019 -0500
Revert "lvconvert: disable linear to mirror of active LV in cluster VG"
This reverts commit 8623e336513c6ac6fcb24aa7e2ef10b8a3a36c59.
The problem this was avoiding now seems to be fixed by
commit d6bce036155ae973c869bdce3ca5f824f933f599
mirror: fix monitoring change
---
tools/lvconvert.c | 11 -----------
1 files changed, 0 insertions(+), 11 deletions(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index fcbbd26..bc666c0 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -864,17 +864,6 @@ static int _lvconvert_mirrors_aux(struct cmd_context *cmd,
/* FIXME Share code with lvcreate */
/*
- * Avoid bug 1711427 in which an exclusively active linear LV in a
- * clustered VG, when upconverted to a mirror, will mistakenly use
- * a userspace/cmirror log in _add_log() beause laopts.exclusive is
- * not set.
- */
- if (vg_is_clustered(lv->vg) && lv_is_active(lv)) {
- log_error("Cannot convert active LV to mirror in clustered VG.");
- return 0;
- }
-
- /*
* FIXME should we give not only pvh, but also all PVs
* currently taken by the mirror? Would make more sense from
* user perspective.
4 years, 10 months
stable-2.02 - tests: check mirror with clvmd and dmeventd
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=1727df7c98b749be90a...
Commit: 1727df7c98b749be90a5790d3d9858a012f687f6
Parent: 29ae8b8ca5935536d9ce55959022918e0343562f
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Jun 19 13:38:57 2019 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Jun 19 13:38:57 2019 +0200
tests: check mirror with clvmd and dmeventd
---
test/shell/lvconvert-mirror-dmeventd.sh | 41 +++++++++++++++++++++++++++++++
1 files changed, 41 insertions(+), 0 deletions(-)
diff --git a/test/shell/lvconvert-mirror-dmeventd.sh b/test/shell/lvconvert-mirror-dmeventd.sh
new file mode 100644
index 0000000..3bebd64
--- /dev/null
+++ b/test/shell/lvconvert-mirror-dmeventd.sh
@@ -0,0 +1,41 @@
+#!/usr/bin/env bash
+
+# Copyright (C) 2018 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, MA 02110-1301 USA
+
+# Check clustered usage with dmeventd
+
+. lib/inittest
+
+aux prepare_dmeventd
+
+aux prepare_pvs 3 100
+get_devs
+
+vgcreate $SHARED -s 64k "$vg" "${DEVICES[@]}"
+
+# Use zero devices for big mirror legs
+aux zero_dev "$dev2" $(get first_extent_sector "$dev2"):
+aux zero_dev "$dev3" $(get first_extent_sector "$dev3"):
+
+lvcreate -aey -L90 --type mirror --corelog --regionsize 16k -m1 -n $lv1 $vg "$dev1" "$dev2"
+
+lvconvert -m+1 -b $vg/$lv1 "$dev3"
+
+# We want here ongoing conversion
+
+lvs -a -o+seg_pe_ranges $vg
+
+# Now it should be able to drop 2nd. leg
+lvconvert -m-1 $vg/$lv1 "$dev2"
+
+lvs -a $vg
+
+vgremove -f $vg
4 years, 10 months