master - man lvmlockd: update list of limitations
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=81f07c3cca417bbf8d2...
Commit: 81f07c3cca417bbf8d290073a20586b47a6d127e
Parent: 885eb2024ffff6757bba39666a1d334d6d72a066
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu May 31 16:38:39 2018 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu May 31 16:38:39 2018 -0500
man lvmlockd: update list of limitations
---
man/lvmlockd.8_main | 11 +----------
1 files changed, 1 insertions(+), 10 deletions(-)
diff --git a/man/lvmlockd.8_main b/man/lvmlockd.8_main
index 90a07c7..9fe569d 100644
--- a/man/lvmlockd.8_main
+++ b/man/lvmlockd.8_main
@@ -843,12 +843,6 @@ to a lockd VG".
Things that do not yet work in lockd VGs:
.br
\[bu]
-creating a new thin pool and a new thin LV in a single command
-.br
-\[bu]
-using lvcreate to create cache pools or cache LVs (use lvconvert)
-.br
-\[bu]
using external origins for thin LVs
.br
\[bu]
@@ -861,10 +855,7 @@ splitting mirrors in sanlock VGs
pvmove of entire PVs, or under LVs activated with shared locks
.br
\[bu]
-vgsplit
-.br
-\[bu]
-vgmerge
+vgsplit and vgmerge (convert to a local VG to do this)
.SS lvmlockd changes from clvmd
5 years, 6 months
master - tests: enable non-working tests with lvmlockd
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=885eb2024ffff6757bb...
Commit: 885eb2024ffff6757bba39666a1d334d6d72a066
Parent: 00f6a8466edfc386067efb1e000a808080966076
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu May 31 16:18:53 2018 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu May 31 16:18:53 2018 -0500
tests: enable non-working tests with lvmlockd
Those that are failing for reasons other than lvmlockd
restrictions.
---
test/shell/component-thin.sh | 2 +-
test/shell/lvconvert-raid-allocation.sh | 4 ++--
test/shell/lvconvert-raid-reshape-load.sh | 4 ++--
.../lvconvert-raid-reshape-stripes-load-fail.sh | 4 ++--
.../lvconvert-raid-reshape-stripes-load-reload.sh | 4 ++--
test/shell/lvconvert-raid-reshape-stripes-load.sh | 4 ++--
test/shell/lvconvert-raid-reshape.sh | 4 ++--
test/shell/lvconvert-raid-status-validation.sh | 4 ++--
test/shell/lvconvert-raid5_to_raid10.sh | 2 +-
test/shell/lvcreate-large-raid.sh | 4 ++--
test/shell/mirror-names.sh | 2 +-
test/shell/pvcreate-md-fake-hdr.sh | 4 ++--
test/shell/pvcreate-operation-md.sh | 2 +-
test/shell/thin-large.sh | 2 +-
14 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/test/shell/component-thin.sh b/test/shell/component-thin.sh
index 4b1a35b..3cf02f3 100644
--- a/test/shell/component-thin.sh
+++ b/test/shell/component-thin.sh
@@ -12,7 +12,7 @@
# Exercise activation of thin component devices
-SKIP_WITH_LVMLOCKD=1
+
SKIP_WITH_LVMPOLLD=1
. lib/inittest
diff --git a/test/shell/lvconvert-raid-allocation.sh b/test/shell/lvconvert-raid-allocation.sh
index 7529800..acdae0c 100644
--- a/test/shell/lvconvert-raid-allocation.sh
+++ b/test/shell/lvconvert-raid-allocation.sh
@@ -10,7 +10,7 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-SKIP_WITH_LVMLOCKD=1
+
SKIP_WITH_LVMPOLLD=1
. lib/inittest
@@ -20,7 +20,7 @@ aux have_raid 1 3 0 || skip
aux prepare_pvs 5
get_devs
-vgcreate -s 256k "$vg" "${DEVICES[@]}"
+vgcreate $SHARED -s 256k "$vg" "${DEVICES[@]}"
# Start with linear on 2 PV and ensure that converting to
# RAID is not allowed to reuse PVs for different images. (Bug 1113180)
diff --git a/test/shell/lvconvert-raid-reshape-load.sh b/test/shell/lvconvert-raid-reshape-load.sh
index cd72d09..11af24d 100644
--- a/test/shell/lvconvert-raid-reshape-load.sh
+++ b/test/shell/lvconvert-raid-reshape-load.sh
@@ -10,7 +10,7 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA2110-1301 USA
-SKIP_WITH_LVMLOCKD=1
+
SKIP_WITH_LVMPOLLD=1
. lib/inittest
@@ -35,7 +35,7 @@ aux prepare_pvs 16 32
get_devs
-vgcreate -s 1M "$vg" "${DEVICES[@]}"
+vgcreate $SHARED -s 1M "$vg" "${DEVICES[@]}"
trap 'cleanup_mounted_and_teardown' EXIT
diff --git a/test/shell/lvconvert-raid-reshape-stripes-load-fail.sh b/test/shell/lvconvert-raid-reshape-stripes-load-fail.sh
index 88722b0..feaf1e2 100644
--- a/test/shell/lvconvert-raid-reshape-stripes-load-fail.sh
+++ b/test/shell/lvconvert-raid-reshape-stripes-load-fail.sh
@@ -10,7 +10,7 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA2110-1301 USA
-SKIP_WITH_LVMLOCKD=1
+
SKIP_WITH_LVMPOLLD=1
. lib/inittest
@@ -35,7 +35,7 @@ aux prepare_pvs 16 32
get_devs
-vgcreate -s 1M "$vg" "${DEVICES[@]}"
+vgcreate $SHARED -s 1M "$vg" "${DEVICES[@]}"
trap 'cleanup_mounted_and_teardown' EXIT
diff --git a/test/shell/lvconvert-raid-reshape-stripes-load-reload.sh b/test/shell/lvconvert-raid-reshape-stripes-load-reload.sh
index fc463bf..839e704 100644
--- a/test/shell/lvconvert-raid-reshape-stripes-load-reload.sh
+++ b/test/shell/lvconvert-raid-reshape-stripes-load-reload.sh
@@ -10,7 +10,7 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA2110-1301 USA
-SKIP_WITH_LVMLOCKD=1
+
SKIP_WITH_LVMPOLLD=1
. lib/inittest
@@ -35,7 +35,7 @@ aux prepare_pvs 16 32
get_devs
-vgcreate -s 1M "$vg" "${DEVICES[@]}"
+vgcreate $SHARED -s 1M "$vg" "${DEVICES[@]}"
trap 'cleanup_mounted_and_teardown' EXIT
diff --git a/test/shell/lvconvert-raid-reshape-stripes-load.sh b/test/shell/lvconvert-raid-reshape-stripes-load.sh
index 1be8d61..29790aa 100644
--- a/test/shell/lvconvert-raid-reshape-stripes-load.sh
+++ b/test/shell/lvconvert-raid-reshape-stripes-load.sh
@@ -10,7 +10,7 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA2110-1301 USA
-SKIP_WITH_LVMLOCKD=1
+
SKIP_WITH_LVMPOLLD=1
. lib/inittest
@@ -35,7 +35,7 @@ aux prepare_pvs 16 32
get_devs
-vgcreate -s 1M "$vg" "${DEVICES[@]}"
+vgcreate $SHARED -s 1M "$vg" "${DEVICES[@]}"
trap 'cleanup_mounted_and_teardown' EXIT
diff --git a/test/shell/lvconvert-raid-reshape.sh b/test/shell/lvconvert-raid-reshape.sh
index e621318..ab3ea4e 100644
--- a/test/shell/lvconvert-raid-reshape.sh
+++ b/test/shell/lvconvert-raid-reshape.sh
@@ -10,7 +10,7 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA2110-1301 USA
-SKIP_WITH_LVMLOCKD=1
+
SKIP_WITH_LVMPOLLD=1
LVM_SKIP_LARGE_TESTS=0
@@ -34,7 +34,7 @@ fi
get_devs
-vgcreate -s 1M "$vg" "${DEVICES[@]}"
+vgcreate $SHARED -s 1M "$vg" "${DEVICES[@]}"
function _lvcreate
{
diff --git a/test/shell/lvconvert-raid-status-validation.sh b/test/shell/lvconvert-raid-status-validation.sh
index 3e91d23..c5396d7 100644
--- a/test/shell/lvconvert-raid-status-validation.sh
+++ b/test/shell/lvconvert-raid-status-validation.sh
@@ -15,7 +15,7 @@
# 'dmsetup status' for RAID LVs - especially during various sync action
# transitions, like: recover, resync, check, repair, idle, reshape, etc
#######################################################################
-SKIP_WITH_LVMLOCKD=1
+
SKIP_WITH_LVMPOLLD=1
export LVM_TEST_LVMETAD_DEBUG_OPTS=${LVM_TEST_LVMETAD_DEBUG_OPTS-}
@@ -33,7 +33,7 @@ aux have_raid 1 13 0 || skip
aux prepare_pvs 9
get_devs
-vgcreate -s 2m "$vg" "${DEVICES[@]}"
+vgcreate $SHARED -s 2m "$vg" "${DEVICES[@]}"
###########################################
# Upconverted RAID1 should never have all 'a's in status output
diff --git a/test/shell/lvconvert-raid5_to_raid10.sh b/test/shell/lvconvert-raid5_to_raid10.sh
index cc0e468..e38e4d3 100644
--- a/test/shell/lvconvert-raid5_to_raid10.sh
+++ b/test/shell/lvconvert-raid5_to_raid10.sh
@@ -10,7 +10,7 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA2110-1301 USA
-SKIP_WITH_LVMLOCKD=1
+
SKIP_WITH_LVMPOLLD=1
. lib/inittest
diff --git a/test/shell/lvcreate-large-raid.sh b/test/shell/lvcreate-large-raid.sh
index 3488db4..b66cfd2 100644
--- a/test/shell/lvcreate-large-raid.sh
+++ b/test/shell/lvcreate-large-raid.sh
@@ -12,7 +12,7 @@
# 'Exercise some lvcreate diagnostics'
-SKIP_WITH_LVMLOCKD=1
+
SKIP_WITH_LVMPOLLD=1
. lib/inittest
@@ -31,7 +31,7 @@ aux have_raid4 && segtypes="raid4 raid5"
aux prepare_pvs 5 1000000000
get_devs
-vgcreate "$vg1" "${DEVICES[@]}"
+vgcreate $SHARED "$vg1" "${DEVICES[@]}"
aux lvmconf 'devices/issue_discards = 1'
diff --git a/test/shell/mirror-names.sh b/test/shell/mirror-names.sh
index a3bc80f..54d42e1 100644
--- a/test/shell/mirror-names.sh
+++ b/test/shell/mirror-names.sh
@@ -13,7 +13,7 @@
test_description="check namings of mirrored LV"
-SKIP_WITH_LVMLOCKD=1
+
. lib/inittest
diff --git a/test/shell/pvcreate-md-fake-hdr.sh b/test/shell/pvcreate-md-fake-hdr.sh
index 50a5b14..b89fe43 100644
--- a/test/shell/pvcreate-md-fake-hdr.sh
+++ b/test/shell/pvcreate-md-fake-hdr.sh
@@ -12,7 +12,7 @@
# TODO: once code get fixed, add matching 'check' calls
-SKIP_WITH_LVMLOCKD=1
+
SKIP_WITH_LVMPOLLD=1
. lib/inittest
@@ -25,7 +25,7 @@ aux extend_filter_LVMTEST "a|/dev/md|"
aux prepare_devs 4
-vgcreate $vg "$dev3" "$dev4"
+vgcreate $SHARED $vg "$dev3" "$dev4"
# create 2 disk MD raid1 array
# by default using metadata format 1.0 with data at the end of device
diff --git a/test/shell/pvcreate-operation-md.sh b/test/shell/pvcreate-operation-md.sh
index f534785..11f0887 100644
--- a/test/shell/pvcreate-operation-md.sh
+++ b/test/shell/pvcreate-operation-md.sh
@@ -10,7 +10,7 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-SKIP_WITH_LVMLOCKD=1
+
SKIP_WITH_LVMPOLLD=1
. lib/inittest
diff --git a/test/shell/thin-large.sh b/test/shell/thin-large.sh
index b1cf29a..714f91e 100644
--- a/test/shell/thin-large.sh
+++ b/test/shell/thin-large.sh
@@ -12,7 +12,7 @@
# 'Exercise logic around boundary sizes of thin-pool data and chunksize
-SKIP_WITH_LVMLOCKD=1
+
SKIP_WITH_LVMPOLLD=1
. lib/inittest
5 years, 6 months
master - tests: enable more working tests with lvmlockd
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=00f6a8466edfc386067...
Commit: 00f6a8466edfc386067efb1e000a808080966076
Parent: 06b2e5c176b7a371efa62b27af2acb1e6f7984be
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu May 31 15:55:18 2018 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu May 31 16:13:58 2018 -0500
tests: enable more working tests with lvmlockd
---
test/shell/lvconvert-repair-cache.sh | 1 -
test/shell/lvconvert-repair.sh | 8 +++++---
test/shell/lvcreate-repair.sh | 5 ++---
test/shell/lvextend-snapshot-dmeventd.sh | 1 -
test/shell/mdata-strings.sh | 3 +--
5 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/test/shell/lvconvert-repair-cache.sh b/test/shell/lvconvert-repair-cache.sh
index 6afb7ea..348dbaf 100644
--- a/test/shell/lvconvert-repair-cache.sh
+++ b/test/shell/lvconvert-repair-cache.sh
@@ -12,7 +12,6 @@
# Test repairing of broken cached LV
-SKIP_WITH_LVMPOLLD=1
SKIP_WITH_LVMLOCKD=1
. lib/inittest
diff --git a/test/shell/lvconvert-repair.sh b/test/shell/lvconvert-repair.sh
index b5ae206..9ee7980 100644
--- a/test/shell/lvconvert-repair.sh
+++ b/test/shell/lvconvert-repair.sh
@@ -10,14 +10,12 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-SKIP_WITH_LVMLOCKD=1
-
. lib/inittest
recreate_vg_()
{
vgremove -ff $vg
- vgcreate "$vg" "$@" "${DEVICES[@]}"
+ vgcreate $SHARED "$vg" "$@" "${DEVICES[@]}"
}
_check_mlog()
@@ -70,7 +68,11 @@ vgreduce --removemissing $vg
aux enable_dev "$dev4"
# 3-way, mirrored log => 3-way, core log
+if test -n "$LVM_TEST_LVMLOCKD"; then
+recreate_vg_
+else
recreate_vg_ -c n
+fi
lvcreate -aey --type mirror -m 2 --mirrorlog mirrored --ignoremonitoring -L 1 -n 3way $vg \
"$dev1" "$dev2" "$dev3" "$dev4":0 "$dev5":0
aux disable_dev "$dev4" "$dev5"
diff --git a/test/shell/lvcreate-repair.sh b/test/shell/lvcreate-repair.sh
index 5e02e7f..cff0018 100644
--- a/test/shell/lvcreate-repair.sh
+++ b/test/shell/lvcreate-repair.sh
@@ -10,7 +10,6 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-SKIP_WITH_LVMLOCKD=1
SKIP_WITH_LVMPOLLD=1
. lib/inittest
@@ -23,7 +22,7 @@ for i in "$dev1" "$dev2" "$dev3" ; do
if test "$i" = "$j" ; then continue ; fi
vgremove -ff $vg
- vgcreate $vg "$dev1" "$dev2" "$dev3"
+ vgcreate $SHARED $vg "$dev1" "$dev2" "$dev3"
# exit 1
lvcreate -l1 -n $lv1 $vg "$dev1"
@@ -49,7 +48,7 @@ for i in "$dev1" "$dev2" "$dev3" ; do
done
vgremove -ff $vg
-vgcreate $vg "$dev1" "$dev2" "$dev3"
+vgcreate $SHARED $vg "$dev1" "$dev2" "$dev3"
# use tricky 'dd'
for i in "$dev1" "$dev2" "$dev3" ; do
diff --git a/test/shell/lvextend-snapshot-dmeventd.sh b/test/shell/lvextend-snapshot-dmeventd.sh
index 0f9b0a9..01fc843 100644
--- a/test/shell/lvextend-snapshot-dmeventd.sh
+++ b/test/shell/lvextend-snapshot-dmeventd.sh
@@ -10,7 +10,6 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-SKIP_WITH_LVMLOCKD=1
SKIP_WITH_LVMPOLLD=1
. lib/inittest
diff --git a/test/shell/mdata-strings.sh b/test/shell/mdata-strings.sh
index 4fcb89c..c87cd75 100644
--- a/test/shell/mdata-strings.sh
+++ b/test/shell/mdata-strings.sh
@@ -12,7 +12,6 @@
# 'Test for proper escaping of strings in metadata (bz431474)'
-SKIP_WITH_LVMLOCKD=1
SKIP_WITH_LVMPOLLD=1
. lib/inittest
@@ -42,7 +41,7 @@ pvcreate "$dev1" || created="$dev2"
pvdisplay 2>&1 | tee err
should grep -F "$pv_ugly" err
should check pv_field "$dev1" pv_name "$dev1"
-vgcreate $vg "$created"
+vgcreate $SHARED $vg "$created"
# 'no parse errors and VG really exists'
vgs $vg 2>err
not grep "Parse error" err
5 years, 6 months
master - lvmlockd: improve error message for existing lockspace
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=06b2e5c176b7a371efa...
Commit: 06b2e5c176b7a371efa62b27af2acb1e6f7984be
Parent: caa600a409fe811a25f2d784daeb6780ea977614
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu May 31 15:52:23 2018 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu May 31 15:52:23 2018 -0500
lvmlockd: improve error message for existing lockspace
When a VG/lockspace already exists with the same name
don't just print the error number.
---
lib/locking/lvmlockd.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/lib/locking/lvmlockd.c b/lib/locking/lvmlockd.c
index 0af2b38..24a46e7 100644
--- a/lib/locking/lvmlockd.c
+++ b/lib/locking/lvmlockd.c
@@ -548,6 +548,9 @@ static int _init_vg_dlm(struct cmd_context *cmd, struct volume_group *vg)
case -EPROTONOSUPPORT:
log_error("VG %s init failed: lock manager dlm is not supported by lvmlockd", vg->name);
break;
+ case -EEXIST:
+ log_error("VG %s init failed: a lockspace with the same name exists", vg->name);
+ break;
default:
log_error("VG %s init failed: %d", vg->name, result);
}
@@ -671,6 +674,9 @@ static int _init_vg_sanlock(struct cmd_context *cmd, struct volume_group *vg, in
case -EMSGSIZE:
log_error("VG %s init failed: no disk space for leases", vg->name);
break;
+ case -EEXIST:
+ log_error("VG %s init failed: a lockspace with the same name exists", vg->name);
+ break;
default:
log_error("VG %s init failed: %d", vg->name, result);
}
5 years, 6 months
master - tests: enable lvcreate-pvtags with lvmlockd
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=caa600a409fe811a25f...
Commit: caa600a409fe811a25f2d784daeb6780ea977614
Parent: b9c1cef8176ad127e682e40b1508816b23c9a989
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu May 31 15:37:25 2018 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu May 31 15:37:25 2018 -0500
tests: enable lvcreate-pvtags with lvmlockd
---
test/shell/lvcreate-pvtags.sh | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/test/shell/lvcreate-pvtags.sh b/test/shell/lvcreate-pvtags.sh
index 893b3ef..b794c45 100644
--- a/test/shell/lvcreate-pvtags.sh
+++ b/test/shell/lvcreate-pvtags.sh
@@ -10,7 +10,6 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-SKIP_WITH_LVMLOCKD=1
SKIP_WITH_LVMPOLLD=1
. lib/inittest
@@ -24,7 +23,7 @@ aux lvmconf 'allocation/maximise_cling = 0' \
# not required, just testing
aux pvcreate --metadatacopies 0 "$dev1"
-vgcreate "$vg" "${DEVICES[@]}"
+vgcreate $SHARED "$vg" "${DEVICES[@]}"
pvchange --addtag fast "${DEVICES[@]}"
# 3 stripes with 3 PVs (selected by tag, @fast) is fine
5 years, 6 months
master - lvmlockd: fix reverting new lv in error path
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b9c1cef8176ad127e68...
Commit: b9c1cef8176ad127e682e40b1508816b23c9a989
Parent: 4a01e4f3895a947c0c693d0336643a1287de6df5
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu May 31 15:35:48 2018 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu May 31 15:35:48 2018 -0500
lvmlockd: fix reverting new lv in error path
The wrong name was being used to free the LV lock
in lvmlockd in the error exit path.
---
lib/metadata/lv_manip.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index c1bba03..c5e63a9 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -8010,7 +8010,7 @@ deactivate_and_revert_new_lv:
revert_new_lv:
lockd_lv(cmd, lv, "un", LDLV_PERSISTENT);
- lockd_free_lv(vg->cmd, vg, lp->lv_name, &lv->lvid.id[1], lv->lock_args);
+ lockd_free_lv(vg->cmd, vg, lv->name, &lv->lvid.id[1], lv->lock_args);
/* FIXME Better to revert to backup of metadata? */
if (!lv_remove(lv) || !vg_write(vg) || !vg_commit(vg))
5 years, 6 months
master - tests: enable metadata-balance with lvmlockd
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=4a01e4f3895a947c0c6...
Commit: 4a01e4f3895a947c0c693d0336643a1287de6df5
Parent: 08771bbbbf20298df0440dd8ca75ca10af60eb2f
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu May 31 15:12:34 2018 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu May 31 15:12:34 2018 -0500
tests: enable metadata-balance with lvmlockd
---
test/shell/metadata-balance.sh | 49 ++++++++++++++++++++++------------------
1 files changed, 27 insertions(+), 22 deletions(-)
diff --git a/test/shell/metadata-balance.sh b/test/shell/metadata-balance.sh
index fe94aed..5f856a1 100644
--- a/test/shell/metadata-balance.sh
+++ b/test/shell/metadata-balance.sh
@@ -10,7 +10,6 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-SKIP_WITH_LVMLOCKD=1
SKIP_WITH_LVMPOLLD=1
. lib/inittest
@@ -23,7 +22,7 @@ for mdacp in 1 2; do
pvcreate --metadatacopies $mdacp "$dev1" "$dev2"
pvcreate --metadatacopies 0 "$dev3"
if [ $pv_in_vg = 1 ]; then
- vgcreate $vg "$dev1" "$dev2" "$dev3"
+ vgcreate $SHARED $vg "$dev1" "$dev2" "$dev3"
fi
pvchange --metadataignore y "$dev1"
check pv_field "$dev1" pv_mda_count $mdacp
@@ -64,7 +63,7 @@ pvunignore_ () {
fi
}
-echo Test of vgmetadatacopies with vgcreate and vgchange
+echo Test of vgmetadatacopies with vgcreate $SHARED and vgchange
for mdacp in 1 2; do
pvcreate --metadatacopies $mdacp "$dev1" "$dev2" "$dev4" "$dev5"
check pv_field "$dev1" pv_mda_used_count $mdacp
@@ -72,7 +71,7 @@ for mdacp in 1 2; do
check pv_field "$dev4" pv_mda_used_count $mdacp
check pv_field "$dev5" pv_mda_used_count $mdacp
pvcreate --metadatacopies 0 "$dev3"
- vgcreate $vg "$dev1" "$dev2" "$dev3"
+ vgcreate $SHARED $vg "$dev1" "$dev2" "$dev3"
check vg_field $vg vg_mda_copies unmanaged
echo ensure both --vgmetadatacopies and --metadatacopies accepted
vgchange --metadatacopies $(( mdacp * 1 )) $vg
@@ -91,34 +90,34 @@ for mdacp in 1 2; do
vgchange --vgmetadatacopies unmanaged $vg
check vg_field $vg vg_mda_copies unmanaged
vgremove -f $vg
- echo vgcreate succeeds even when creating a VG w/all ignored mdas
+ echo vgcreate $SHARED succeeds even when creating a VG w/all ignored mdas
pvchange --metadataignore y "$dev1" "$dev2"
check pv_field "$dev1" pv_mda_count $mdacp
check pv_field "$dev2" pv_mda_used_count 0
- vgcreate $vg "$dev1" "$dev2"
+ vgcreate $SHARED $vg "$dev1" "$dev2"
check vg_field $vg vg_mda_copies unmanaged
vgremove -f $vg
- echo vgcreate succeeds with a specific number of metadata copies
- vgcreate --vgmetadatacopies $(( mdacp * 2 )) $vg "$dev1" "$dev2"
+ echo vgcreate $SHARED succeeds with a specific number of metadata copies
+ vgcreate $SHARED --vgmetadatacopies $(( mdacp * 2 )) $vg "$dev1" "$dev2"
check vg_field $vg vg_mda_copies $(( mdacp * 2 ))
vgremove -f $vg
- vgcreate --vgmetadatacopies $(( mdacp * 1 )) $vg "$dev1" "$dev2"
+ vgcreate $SHARED --vgmetadatacopies $(( mdacp * 1 )) $vg "$dev1" "$dev2"
check vg_field $vg vg_mda_copies $(( mdacp * 1 ))
vgremove -f $vg
- echo vgcreate succeeds with a larger value than total metadatacopies
- vgcreate --vgmetadatacopies $(( mdacp * 5 )) $vg "$dev1" "$dev2"
+ echo vgcreate $SHARED succeeds with a larger value than total metadatacopies
+ vgcreate $SHARED --vgmetadatacopies $(( mdacp * 5 )) $vg "$dev1" "$dev2"
check vg_field $vg vg_mda_copies $(( mdacp * 5 ))
vgremove -f $vg
- echo vgcreate succeeds with --vgmetadatacopies unmanaged
- vgcreate --vgmetadatacopies unmanaged $vg "$dev1" "$dev2"
+ echo vgcreate $SHARED succeeds with --vgmetadatacopies unmanaged
+ vgcreate $SHARED --vgmetadatacopies unmanaged $vg "$dev1" "$dev2"
check vg_field $vg vg_mda_copies unmanaged
vgremove -f $vg
pvunignore_ "$dev1"
pvunignore_ "$dev2"
pvunignore_ "$dev4"
pvunignore_ "$dev5"
- echo vgcreate succeds with small value of --metadatacopies, ignores mdas
- vgcreate --vgmetadatacopies 1 $vg "$dev1" "$dev2" "$dev4" "$dev5"
+ echo vgcreate $SHARED succeds with small value of --metadatacopies, ignores mdas
+ vgcreate $SHARED --vgmetadatacopies 1 $vg "$dev1" "$dev2" "$dev4" "$dev5"
check vg_field $vg vg_mda_copies 1
check vg_field $vg vg_mda_count $(( mdacp * 4 ))
check vg_field $vg vg_mda_used_count 1
@@ -131,11 +130,11 @@ for mdacp in 1 2; do
check vg_field $vg vg_mda_count $(( mdacp * 4 ))
check vg_field $vg vg_mda_copies unmanaged
check vg_field $vg vg_mda_used_count $(( mdacp * 4 ))
- echo --vgmetadatacopies 0 should be unmanaged for vgchange and vgcreate
+ echo --vgmetadatacopies 0 should be unmanaged for vgchange and vgcreate $SHARED
vgchange --vgmetadatacopies 0 $vg
check vg_field $vg vg_mda_copies unmanaged
vgremove -f $vg
- vgcreate --vgmetadatacopies 0 $vg "$dev1" "$dev2" "$dev4" "$dev5"
+ vgcreate $SHARED --vgmetadatacopies 0 $vg "$dev1" "$dev2" "$dev4" "$dev5"
check vg_field $vg vg_mda_copies unmanaged
vgremove -f $vg
done
@@ -145,7 +144,7 @@ for mdacp in 1 2; do
pvcreate --metadatacopies $mdacp "$dev1" "$dev2" "$dev4" "$dev5"
pvcreate --metadatacopies 0 "$dev3"
echo Set a large value of vgmetadatacopies
- vgcreate --vgmetadatacopies $(( mdacp * 5 )) $vg "$dev1" "$dev2" "$dev3"
+ vgcreate $SHARED --vgmetadatacopies $(( mdacp * 5 )) $vg "$dev1" "$dev2" "$dev3"
check vg_field $vg vg_mda_copies $(( mdacp * 5 ))
echo Ignore mdas on devices to be used for vgextend
echo Large value of vgetadatacopies should automatically un-ignore mdas
@@ -156,7 +155,7 @@ for mdacp in 1 2; do
check pv_field "$dev5" pv_mda_used_count $mdacp
vgremove -f $vg
echo Set a small value of vgmetadatacopies
- vgcreate --vgmetadatacopies $(( mdacp * 1 )) $vg "$dev1" "$dev2" "$dev3"
+ vgcreate $SHARED --vgmetadatacopies $(( mdacp * 1 )) $vg "$dev1" "$dev2" "$dev3"
check vg_field $vg vg_mda_copies $(( mdacp * 1 ))
echo Ignore mdas on devices to be used for vgextend
echo Small value of vgetadatacopies should leave mdas as ignored
@@ -186,11 +185,15 @@ for mdacp in 1 2; do
vgremove -f $vg
done
+if test -n "$LVM_TEST_LVMLOCKD"; then
+echo skip vgsplit and vgmerge with lvmlockd
+else
+
echo Test special situations, vgsplit, vgmerge, etc
for mdacp in 1 2; do
pvcreate --metadatacopies $mdacp "$dev1" "$dev2" "$dev3" "$dev4" "$dev5"
- vgcreate --vgmetadatacopies 2 $vg1 "$dev1" "$dev2" "$dev3"
- vgcreate --vgmetadatacopies $(( mdacp * 1 )) $vg2 "$dev4" "$dev5"
+ vgcreate $SHARED --vgmetadatacopies 2 $vg1 "$dev1" "$dev2" "$dev3"
+ vgcreate $SHARED --vgmetadatacopies $(( mdacp * 1 )) $vg2 "$dev4" "$dev5"
echo vgsplit/vgmerge preserves value of metadata copies
check vg_field $vg1 vg_mda_copies 2
check vg_field $vg2 vg_mda_copies $(( mdacp * 1 ))
@@ -207,10 +210,12 @@ for mdacp in 1 2; do
vgremove -f $vg1 $vg2
done
+fi
+
echo Test combination of --vgmetadatacopies and pvchange --metadataignore
for mdacp in 1 2; do
pvcreate --metadatacopies $mdacp "$dev1" "$dev2" "$dev3" "$dev4" "$dev5"
- vgcreate --vgmetadatacopies $(( mdacp * 1 )) $vg1 "$dev1" "$dev2"
+ vgcreate $SHARED --vgmetadatacopies $(( mdacp * 1 )) $vg1 "$dev1" "$dev2"
check vg_field $vg1 vg_mda_copies $(( mdacp * 1 ))
check vg_field $vg1 vg_mda_used_count $(( mdacp * 1 ))
pvignore_ "$dev3"
5 years, 6 months
master - tests: enable lvmlockd with tests using lvcreate -H -L LV
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=08771bbbbf20298df04...
Commit: 08771bbbbf20298df0440dd8ca75ca10af60eb2f
Parent: 8d9d32b315afd0fb2b674ca3bb857cb4ce2cbf2e
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu May 31 14:49:16 2018 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu May 31 14:49:16 2018 -0500
tests: enable lvmlockd with tests using lvcreate -H -L LV
---
test/shell/lvcreate-cache-no-tools.sh | 2 +-
test/shell/lvcreate-cache-raid.sh | 2 +-
test/shell/lvcreate-cache.sh | 2 +-
test/shell/lvcreate-thin-cache.sh | 4 ++--
test/shell/lvextend-thin-cache.sh | 2 +-
test/shell/lvs-cache.sh | 2 +-
6 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/test/shell/lvcreate-cache-no-tools.sh b/test/shell/lvcreate-cache-no-tools.sh
index c38ecfd..23528e4 100644
--- a/test/shell/lvcreate-cache-no-tools.sh
+++ b/test/shell/lvcreate-cache-no-tools.sh
@@ -12,7 +12,7 @@
# Exercise creation of cache without cache_check
-SKIP_WITH_LVMLOCKD=1
+
SKIP_WITH_LVMPOLLD=1
. lib/inittest
diff --git a/test/shell/lvcreate-cache-raid.sh b/test/shell/lvcreate-cache-raid.sh
index d540d4e..d1d1c19 100644
--- a/test/shell/lvcreate-cache-raid.sh
+++ b/test/shell/lvcreate-cache-raid.sh
@@ -12,7 +12,7 @@
# Exercise creation of cache and raids
-SKIP_WITH_LVMLOCKD=1
+
SKIP_WITH_LVMPOLLD=1
. lib/inittest
diff --git a/test/shell/lvcreate-cache.sh b/test/shell/lvcreate-cache.sh
index 8edbeb2..010c06f 100644
--- a/test/shell/lvcreate-cache.sh
+++ b/test/shell/lvcreate-cache.sh
@@ -15,7 +15,7 @@
# Full CLI uses --type
# Shorthand CLI uses -H | --cache
-SKIP_WITH_LVMLOCKD=1
+
SKIP_WITH_LVMPOLLD=1
. lib/inittest
diff --git a/test/shell/lvcreate-thin-cache.sh b/test/shell/lvcreate-thin-cache.sh
index 0b9f3c8..f87526a 100644
--- a/test/shell/lvcreate-thin-cache.sh
+++ b/test/shell/lvcreate-thin-cache.sh
@@ -12,7 +12,7 @@
# Exercise caching thin-pool's data LV
-SKIP_WITH_LVMLOCKD=1
+
SKIP_WITH_LVMPOLLD=1
export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false}
@@ -30,7 +30,7 @@ which mkfs.ext4 || skip
aux prepare_pvs 2 64
get_devs
-vgcreate -s 64K "$vg" "${DEVICES[@]}"
+vgcreate $SHARED -s 64K "$vg" "${DEVICES[@]}"
lvcreate -L10M -V10M -T $vg/pool --name $lv1
diff --git a/test/shell/lvextend-thin-cache.sh b/test/shell/lvextend-thin-cache.sh
index 8983b7d..f7bbfd9 100644
--- a/test/shell/lvextend-thin-cache.sh
+++ b/test/shell/lvextend-thin-cache.sh
@@ -12,7 +12,7 @@
# Exercise resize of cached thin pool data volumes
-SKIP_WITH_LVMLOCKD=1
+
SKIP_WITH_LVMPOLLD=1
export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false}
diff --git a/test/shell/lvs-cache.sh b/test/shell/lvs-cache.sh
index 84ac026..62d45ac 100644
--- a/test/shell/lvs-cache.sh
+++ b/test/shell/lvs-cache.sh
@@ -15,7 +15,7 @@
# Full CLI uses --type
# Shorthand CLI uses -H | --cache
-SKIP_WITH_LVMLOCKD=1
+
SKIP_WITH_LVMPOLLD=1
. lib/inittest
5 years, 6 months
master - lvmlockd: enable lvcreate -H -L LV
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=8d9d32b315afd0fb2b6...
Commit: 8d9d32b315afd0fb2b674ca3bb857cb4ce2cbf2e
Parent: fdaa7e2e87d4a59b39e701961da6961f371ca980
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu May 31 14:20:11 2018 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu May 31 14:20:11 2018 -0500
lvmlockd: enable lvcreate -H -L LV
Allow this command in a shared VG which had previously been
disallowed.
---
tools/lvcreate.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/tools/lvcreate.c b/tools/lvcreate.c
index 7f97ebd..867cde1 100644
--- a/tools/lvcreate.c
+++ b/tools/lvcreate.c
@@ -1230,6 +1230,14 @@ static int _determine_cache_argument(struct volume_group *vg,
log_verbose("Skipping activation of cache origin %s.",
display_lvname(lv));
return 1;
+
+ } else if (is_lockd_type(vg->lock_type)) {
+ if (!lv_active_change(cmd, lv, CHANGE_AEY, 0)) {
+ log_error("Cannot activate cache origin %s.",
+ display_lvname(lv));
+ return 0;
+ }
+
} else if (!activate_lv_excl_local(cmd, lv)) {
log_error("Cannot activate cache origin %s.",
display_lvname(lv));
@@ -1638,8 +1646,7 @@ static int _lvcreate_single(struct cmd_context *cmd, const char *vg_name,
lp->snapshot ? lp->origin_name : "", lp->segtype->name);
if (is_lockd_type(vg->lock_type)) {
- if (cmd->command->command_enum == lvcreate_thin_vol_with_thinpool_or_sparse_snapshot_CMD ||
- cmd->command->command_enum == lvcreate_cache_vol_with_new_origin_or_convert_to_cache_vol_with_cachepool_CMD) {
+ if (cmd->command->command_enum == lvcreate_thin_vol_with_thinpool_or_sparse_snapshot_CMD) {
log_error("Use lvconvert to create thin pools and cache pools in a shared VG.");
goto out;
}
5 years, 6 months
master - vgs: add report field for shared
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=fdaa7e2e87d4a59b39e...
Commit: fdaa7e2e87d4a59b39e701961da6961f371ca980
Parent: 2beb3009bd7e34604dbd4f03c95fb7cd85eb98a6
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu May 31 10:23:03 2018 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu May 31 10:23:03 2018 -0500
vgs: add report field for shared
equivalent to a non-empty -o locktype.
---
lib/metadata/metadata-exported.h | 1 +
lib/metadata/metadata.c | 5 +++++
lib/report/columns.h | 1 +
lib/report/properties.c | 2 ++
lib/report/report.c | 8 ++++++++
lib/report/values.h | 1 +
6 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h
index ccf6004..916d029 100644
--- a/lib/metadata/metadata-exported.h
+++ b/lib/metadata/metadata-exported.h
@@ -1310,6 +1310,7 @@ int validate_vg_rename_params(struct cmd_context *cmd,
const char *vg_name_new);
int is_lockd_type(const char *lock_type);
+int vg_is_shared(const struct volume_group *vg);
int is_system_id_allowed(struct cmd_context *cmd, const char *system_id);
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index da66e15..ab53bfa 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -6052,6 +6052,11 @@ int is_lockd_type(const char *lock_type)
return 0;
}
+int vg_is_shared(const struct volume_group *vg)
+{
+ return (vg->lock_type && is_lockd_type(vg->lock_type));
+}
+
int vg_strip_outdated_historical_lvs(struct volume_group *vg) {
struct glv_list *glvl, *tglvl;
time_t current_time = time(NULL);
diff --git a/lib/report/columns.h b/lib/report/columns.h
index be39ed9..827a157 100644
--- a/lib/report/columns.h
+++ b/lib/report/columns.h
@@ -211,6 +211,7 @@ FIELD(VGS, vg, BIN, "Exported", cmd, 10, vgexported, vg_exported, "Set if VG is
FIELD(VGS, vg, BIN, "Partial", cmd, 10, vgpartial, vg_partial, "Set if VG is partial.", 0)
FIELD(VGS, vg, STR, "AllocPol", cmd, 10, vgallocationpolicy, vg_allocation_policy, "VG allocation policy.", 0)
FIELD(VGS, vg, BIN, "Clustered", cmd, 10, vgclustered, vg_clustered, "Set if VG is clustered.", 0)
+FIELD(VGS, vg, BIN, "Shared", cmd, 7, vgshared, vg_shared, "Set if VG is shared.", 0)
FIELD(VGS, vg, SIZ, "VSize", cmd, 0, vgsize, vg_size, "Total size of VG in current units.", 0)
FIELD(VGS, vg, SIZ, "VFree", cmd, 0, vgfree, vg_free, "Total amount of free space in current units.", 0)
FIELD(VGS, vg, STR, "SYS ID", cmd, 0, vgsystemid, vg_sysid, "System ID of the VG indicating which host owns it.", 0)
diff --git a/lib/report/properties.c b/lib/report/properties.c
index 8e86b7a..72c8f32 100644
--- a/lib/report/properties.c
+++ b/lib/report/properties.c
@@ -213,6 +213,8 @@ GET_PV_NUM_PROPERTY_FN(pv_ba_size, SECTOR_SIZE * pv->ba_size)
#define _vg_allocation_policy_get prop_not_implemented_get
#define _vg_clustered_set prop_not_implemented_set
#define _vg_clustered_get prop_not_implemented_get
+#define _vg_shared_set prop_not_implemented_set
+#define _vg_shared_get prop_not_implemented_get
#define _lv_layout_set prop_not_implemented_set
#define _lv_layout_get prop_not_implemented_get
diff --git a/lib/report/report.c b/lib/report/report.c
index 01ab627..19f0f5c 100644
--- a/lib/report/report.c
+++ b/lib/report/report.c
@@ -3385,6 +3385,14 @@ static int _vgclustered_disp(struct dm_report *rh, struct dm_pool *mem,
return _binary_disp(rh, mem, field, clustered, GET_FIRST_RESERVED_NAME(vg_clustered_y), private);
}
+static int _vgshared_disp(struct dm_report *rh, struct dm_pool *mem,
+ struct dm_report_field *field,
+ const void *data, void *private)
+{
+ int shared = (vg_is_shared((const struct volume_group *) data)) != 0;
+ return _binary_disp(rh, mem, field, shared, GET_FIRST_RESERVED_NAME(vg_shared_y), private);
+}
+
static int _lvlayout_disp(struct dm_report *rh, struct dm_pool *mem,
struct dm_report_field *field,
const void *data, void *private)
diff --git a/lib/report/values.h b/lib/report/values.h
index 7c53651..96729ef 100644
--- a/lib/report/values.h
+++ b/lib/report/values.h
@@ -60,6 +60,7 @@ FIELD_RESERVED_BINARY_VALUE(vg_extendable, vg_extendable, "", "extendable")
FIELD_RESERVED_BINARY_VALUE(vg_exported, vg_exported, "", "exported")
FIELD_RESERVED_BINARY_VALUE(vg_partial, vg_partial, "", "partial")
FIELD_RESERVED_BINARY_VALUE(vg_clustered, vg_clustered, "", "clustered")
+FIELD_RESERVED_BINARY_VALUE(vg_shared, vg_shared, "", "shared")
FIELD_RESERVED_VALUE(NAMED, vg_permissions, vg_permissions_rw, "", "writeable", "writeable", "rw", "read-write")
FIELD_RESERVED_VALUE(NAMED, vg_permissions, vg_permissions_r, "", "read-only", "read-only", "r", "ro")
FIELD_RESERVED_VALUE(NOFLAG, vg_mda_copies, vg_mda_copies_unmanaged, "", &GET_TYPE_RESERVED_VALUE(num_undef_64), "unmanaged")
5 years, 6 months