v2_03_21 annotated tag has been created
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a6c8d2429ce4d4a1375...
Commit: a6c8d2429ce4d4a13750f271987702d3e2648904
Parent: 0000000000000000000000000000000000000000
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: 2023-04-21 08:40 +0000
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: 2023-04-21 08:40 +0000
annotated tag: v2_03_21 has been created
at a6c8d2429ce4d4a13750f271987702d3e2648904 (tag)
tagging 54efdab230ec4f6d10ffdb9170b07c0664c157ea (commit)
replaces v2_03_20
Release 2.03.21
Mostly bugfix release.
Allow (write)cache over raid+integrity LVs.
-----BEGIN PGP SIGNATURE-----
iQJIBAABCAAyFiEE1QGkeEQK4v0TChvouREkMeUJA58FAmRCTFgUHG1jc29udG9z
QHJlZGhhdC5jb20ACgkQuREkMeUJA5+9DhAAg2MEQKqTajeii61DteENXdmR2hUi
PiMDZF3WjwORxxrjut+c5B/Lvj3gDPnkxPjHJ7SXEQzrBly6Wec5r+i9iRgSdQkj
5XnGMdkm3qz9KeQgFz6U5/tWBT8EV3ux7ZZEIITKIZyyWQeVUIlLlrkJHoECqlDe
b3yM3EY/0K8cs2KVEbvXnKDlSZPn6Q980tE60Tt0MUbLOfxiJNdopNzT4RcHaJW9
A0PTmhHVzJjTla00Y3mRBPy16mQrztkeaC/WDxHx6XhCspd0I251rrrthLH+6szA
nS/ISXwdWCOlZDx4WjpZY35EPcfaAGk2ADrVLuB3Tk073nYSTFpBO596VvYvEkwl
TMBb4xqR81jMbOnUSRgGdAoGFOKwcQ0q5HXaVaq4UZZy50Ot36fPCpLDrrxT+2LI
xVrzgayTdEIgJqFetsGuT2+zqhdIH7iV76Jy/vpFf6Yvq9+4YIdlgxkhPU2RKWR9
rQiocPBkMta83meD9pklyJMlGp27ECSrwQpEaQLbQrlHp+b2vE1T+3OXbpeD4ns/
ytk5IIorKMFv4k8LdkSbfttObcSks1znMrLJj9HnObKmuTcpLPpNwAjNzSYswD4h
Hw3RPA8+OWoa0hgA0hRH8U57rU0EQEyJjQMQZJjKfu52YXVZTjiszvWtaPbwTqn1
upppjSiwzZxjAMU=
=uCmk
-----END PGP SIGNATURE-----
Adam Williamson (1):
Fix import of utils from lvmdbusd.cfg
David Teigland (5):
tests: integrity fixes
raidintegrity: allow writecache and cache
support 16KB page size
remove extra change from support 16KB page size
cache: fix snapshot of cache with cachevol
Marian Csontos (2):
post-release
pre-release
Tony Asleson (2):
lvmdbusd: Correct locking for _common_log
lvmdbusd: Correct seg. fault on s390x ELN
Vojtech Trefny (1):
lvmdbusd: Add a flag to activate LVs in shared mode to Lv.Activate
Zdenek Kabelac (9):
integrity: hide creation of internal LVs
configure.ac: print locking dir
configure: update
cleanup: simplify
cleanup: rename function
vdo: use fixed size vdopool wrapper
tests: lower demand for disk resources
tests: use less demanding ext4
WHATS_NEW: update
5 months, 2 weeks
main - lvmdbusd: Add a flag to activate LVs in shared mode to Lv.Activate
by Tony Asleson
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=7807672975cc991720d...
Commit: 7807672975cc991720d817b4e541ca5e720df26e
Parent: 317071ec53c2f6e338c53a8964fdbb61dc3e8b57
Author: Vojtech Trefny <vtrefny(a)redhat.com>
AuthorDate: Thu Apr 20 11:49:21 2023 +0200
Committer: Tony Asleson <tasleson(a)redhat.com>
CommitterDate: Thu Apr 20 12:09:11 2023 -0500
lvmdbusd: Add a flag to activate LVs in shared mode to Lv.Activate
---
daemons/lvmdbusd/cmdhandler.py | 4 ++++
test/dbus/lvmdbustest.py | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/daemons/lvmdbusd/cmdhandler.py b/daemons/lvmdbusd/cmdhandler.py
index cf2a70875..cf9803e76 100644
--- a/daemons/lvmdbusd/cmdhandler.py
+++ b/daemons/lvmdbusd/cmdhandler.py
@@ -787,6 +787,10 @@ def activate_deactivate(op, name, activate, control_flags, options):
if (1 << 5) & control_flags:
cmd.append('--ignoreactivationskip')
+ # Shared locking (Cluster)
+ if (1 << 6) & control_flags:
+ op += 's'
+
if activate:
op += 'y'
else:
diff --git a/test/dbus/lvmdbustest.py b/test/dbus/lvmdbustest.py
index 8f95757eb..475f328cb 100755
--- a/test/dbus/lvmdbustest.py
+++ b/test/dbus/lvmdbustest.py
@@ -1243,7 +1243,7 @@ class TestDbusService(unittest.TestCase):
self._check_consistency()
# Try control flags
- for i in range(0, 5):
+ for i in range(0, 6):
self.handle_return(lv_p.Lv.Activate(
dbus.UInt64(1 << i),
5 months, 2 weeks
main - cache: fix snapshot of cache with cachevol
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=317071ec53c2f6e338c...
Commit: 317071ec53c2f6e338c53a8964fdbb61dc3e8b57
Parent: 8458ff9ad18c518b774d16358e28a805057e4dc1
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Apr 10 11:41:28 2023 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Apr 10 12:44:22 2023 -0500
cache: fix snapshot of cache with cachevol
Creating a snapshot of a cache LV with a cachevol would fail
because cache_check was not being skipped.
---
lib/activate/dev_manager.c | 2 +
test/shell/caching-snapshot.sh | 162 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 164 insertions(+)
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index ec642f421..07d58733e 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -3694,6 +3694,8 @@ static int _add_new_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree,
if (lv_is_cache(lv) && lv_is_cache_vol(first_seg(lv)->pool_lv) &&
/* Register callback only for layer activation or non-layered cache LV */
(layer || !lv_layer(lv)) &&
+ /* Register callback when cachevol LV is NOT already active */
+ !_cached_dm_info(dm->mem, dtree, first_seg(lv)->pool_lv, NULL) &&
!_pool_register_callback(dm, dnode, lv))
return_0;
diff --git a/test/shell/caching-snapshot.sh b/test/shell/caching-snapshot.sh
new file mode 100644
index 000000000..d73f4ad06
--- /dev/null
+++ b/test/shell/caching-snapshot.sh
@@ -0,0 +1,162 @@
+#!/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
+
+# Test snapshot on cache|writecache
+
+SKIP_WITH_LVMPOLLD=1
+
+. lib/inittest
+
+lvm segtypes 2>/dev/null | grep writecache$ >/dev/null || {
+ skip 'Writecache is not built-in.'
+}
+aux have_cache 1 10 0 || skip
+which mkfs.ext4 || skip
+
+mount_dir="mnt"
+mkdir -p "$mount_dir"
+
+mount_dir_snap="mnt_snap"
+mkdir -p "$mount_dir_snap"
+
+# generate random data
+dd if=/dev/urandom of=pattern1 bs=512K count=1
+
+aux prepare_devs 2 310
+
+vgcreate $SHARED $vg "$dev1" "$dev2"
+
+# creating a snapshot on top of a cache|writecache
+
+test_snap_create() {
+ # cache | writecache
+ local convert_type=$1
+
+ # --cachepool | --cachevol
+ local convert_option=$2
+
+ lvcreate -n $lv1 -L 300 -an $vg "$dev1"
+ lvcreate -n fast -l 4 -an $vg "$dev2"
+ lvconvert -y --type $convert_type $convert_option fast $vg/$lv1
+ lvchange -ay $vg/$lv1
+ mkfs.ext4 "$DM_DEV_DIR/$vg/$lv1"
+ mount "$DM_DEV_DIR/$vg/$lv1" "$mount_dir"
+ cp pattern1 "$mount_dir/pattern1a"
+ lvcreate -s -L 32 -n snap $vg/$lv1
+ cp pattern1 "$mount_dir/pattern1b"
+ mount "$DM_DEV_DIR/$vg/snap" "$mount_dir_snap"
+ not ls "$mount_dir_snap/pattern1b"
+ rm "$mount_dir/pattern1a"
+ diff pattern1 "$mount_dir_snap/pattern1a"
+ umount "$mount_dir_snap"
+ lvconvert --splitcache $vg/$lv1
+ umount "$mount_dir"
+ lvchange -an $vg/$lv1
+ lvchange -an $vg/fast
+ lvremove $vg/snap
+ lvremove $vg/$lv1
+ lvremove $vg/fast
+}
+
+test_snap_create cache --cachepool
+test_snap_create cache --cachevol
+test_snap_create writecache --cachevol
+
+# removing cache|writecache while snapshot exists
+
+test_snap_remove() {
+ # cache | writecache
+ local convert_type=$1
+
+ # --cachepool | --cachevol
+ local convert_option=$2
+
+ lvcreate -n $lv1 -L 300 -an $vg "$dev1"
+ lvcreate -n fast -l 4 -an $vg "$dev2"
+ lvconvert -y --type $convert_type $convert_option fast $vg/$lv1
+ lvchange -ay $vg/$lv1
+ mkfs.ext4 "$DM_DEV_DIR/$vg/$lv1"
+ mount "$DM_DEV_DIR/$vg/$lv1" "$mount_dir"
+ cp pattern1 "$mount_dir/pattern1a"
+ lvcreate -s -L 32 -n snap $vg/$lv1
+ cp pattern1 "$mount_dir/pattern1b"
+ lvconvert --splitcache $vg/$lv1
+ mount "$DM_DEV_DIR/$vg/snap" "$mount_dir_snap"
+ not ls "$mount_dir_snap/pattern1b"
+ rm "$mount_dir/pattern1a"
+ diff pattern1 "$mount_dir_snap/pattern1a"
+ umount "$mount_dir_snap"
+ umount "$mount_dir"
+ lvchange -an $vg/$lv1
+ lvchange -an $vg/fast
+ lvremove $vg/snap
+ lvremove $vg/$lv1
+ lvremove $vg/fast
+}
+
+test_snap_remove cache --cachepool
+test_snap_remove cache --cachevol
+test_snap_remove writecache --cachevol
+
+# adding cache|writecache to an LV that has a snapshot
+
+test_caching_with_snap() {
+ # cache | writecache
+ local convert_type=$1
+
+ # --cachepool | --cachevol
+ local convert_option=$2
+
+ lvcreate -n $lv1 -L 300 -an $vg "$dev1"
+ lvcreate -n fast -l 4 -an $vg "$dev2"
+ lvchange -ay $vg/$lv1
+ mkfs.ext4 "$DM_DEV_DIR/$vg/$lv1"
+ mount "$DM_DEV_DIR/$vg/$lv1" "$mount_dir"
+ cp pattern1 "$mount_dir/pattern1a"
+ lvcreate -s -L 32 -n snap $vg/$lv1
+ lvconvert -y --type $convert_type $convert_option fast $vg/$lv1
+ cp pattern1 "$mount_dir/pattern1b"
+ mount "$DM_DEV_DIR/$vg/snap" "$mount_dir_snap"
+ not ls "$mount_dir_snap/pattern1b"
+ mv "$mount_dir/pattern1a" "$mount_dir/pattern1c"
+ diff pattern1 "$mount_dir_snap/pattern1a"
+ lvconvert --splitcache $vg/$lv1
+ diff pattern1 "$mount_dir/pattern1c"
+ diff pattern1 "$mount_dir_snap/pattern1a"
+ umount "$mount_dir_snap"
+ umount "$mount_dir"
+ lvchange -an $vg/$lv1
+ lvchange -an $vg/fast
+ lvremove $vg/snap
+ lvremove $vg/$lv1
+ lvremove $vg/fast
+}
+
+test_caching_with_snap cache --cachepool
+test_caching_with_snap cache --cachevol
+test_caching_with_snap writecache --cachevol
+
+# adding cache|writecache to a snapshot is not allowed
+
+lvcreate -n $lv1 -L 300 $vg "$dev1"
+lvcreate -n fast -l 4 $vg "$dev2"
+mkfs.ext4 "$DM_DEV_DIR/$vg/$lv1"
+lvcreate -s -L 32 -n snap $vg/$lv1
+not lvconvert -y --type writecache --cachevol fast $vg/snap
+not lvconvert -y --type cache --cachevol fast $vg/snap
+not lvconvert -y --type cache --cachepool fast $vg/snap
+vgchange -an $vg
+lvremove $vg/snap
+lvremove $vg/$lv1
+lvremove $vg/fast
+
+vgremove -ff $vg
5 months, 3 weeks
main - remove extra change from support 16KB page size
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=8458ff9ad18c518b774...
Commit: 8458ff9ad18c518b774d16358e28a805057e4dc1
Parent: b443eac6efd29a72a4356f54c713cc9a0e0da866
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Apr 7 15:57:28 2023 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Apr 7 15:57:28 2023 -0500
remove extra change from support 16KB page size
---
lib/config/config.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/lib/config/config.c b/lib/config/config.c
index 2bb55daeb..5986e64b1 100644
--- a/lib/config/config.c
+++ b/lib/config/config.c
@@ -540,9 +540,6 @@ int config_file_read_fd(struct dm_config_tree *cft, struct device *dev, dev_io_r
log_sys_error("read", dev_name(dev));
goto out;
}
-
- if (!sz)
- goto out;
}
} else {
if (!dev_read_bytes(dev, offset, size, buf))
5 months, 4 weeks
main - support 16KB page size
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b443eac6efd29a72a43...
Commit: b443eac6efd29a72a4356f54c713cc9a0e0da866
Parent: b1789b84c39a10241f3e09a4bad16e482db784e4
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Apr 7 09:05:07 2023 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Apr 7 14:26:09 2023 -0500
support 16KB page size
---
lib/config/config.c | 3 +++
lib/metadata/metadata.c | 3 +++
tools/pvck.c | 7 +++++--
3 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/lib/config/config.c b/lib/config/config.c
index 5986e64b1..2bb55daeb 100644
--- a/lib/config/config.c
+++ b/lib/config/config.c
@@ -540,6 +540,9 @@ int config_file_read_fd(struct dm_config_tree *cft, struct device *dev, dev_io_r
log_sys_error("read", dev_name(dev));
goto out;
}
+
+ if (!sz)
+ goto out;
}
} else {
if (!dev_read_bytes(dev, offset, size, buf))
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index 10af75665..07244bf6a 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -119,6 +119,7 @@ int get_default_pvmetadatasize_sectors(void)
* pagesizes:
* 4096 = 8 sectors.
* 8192 = 16 sectors.
+ * 16384 = 32 sectors.
* 65536 = 128 sectors.
*/
@@ -127,6 +128,8 @@ int get_default_pvmetadatasize_sectors(void)
return 2040;
case 8192:
return 2032;
+ case 16384:
+ return 2016;
case 65536:
return 1920;
}
diff --git a/tools/pvck.c b/tools/pvck.c
index 5273da63c..879810b76 100644
--- a/tools/pvck.c
+++ b/tools/pvck.c
@@ -1146,7 +1146,10 @@ static int _dump_label_and_pv_header(struct cmd_context *cmd, uint64_t labelsect
* mda1 offset is page size from machine that created it,
* warn if it's not one of the expected page sizes.
*/
- if ((*mda1_offset != 4096) && (*mda1_offset != 8192) && (*mda1_offset != 65536)) {
+ if ((*mda1_offset != 4096) &&
+ (*mda1_offset != 8192) &&
+ (*mda1_offset != 16384) &&
+ (*mda1_offset != 65536)) {
log_print("WARNING: pv_header.disk_locn[%d].offset %llu is unexpected # for first mda",
di, (unsigned long long)*mda1_offset);
}
@@ -1273,7 +1276,7 @@ static int _dump_mda_header(struct cmd_context *cmd, struct settings *set,
uint64_t meta_offset = 0; /* bytes */
uint64_t meta_size = 0; /* bytes */
uint32_t meta_checksum = 0;
- int mda_num = (mda_offset == 4096) ? 1 : 2;
+ int mda_num = (mda_offset <= 65536) ? 1 : 2;
int bad = 0;
*checksum0_ret = 0; /* checksum from raw_locn[0] */
5 months, 4 weeks
main - WHATS_NEW: update
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b1789b84c39a10241f3...
Commit: b1789b84c39a10241f3e09a4bad16e482db784e4
Parent: e59e7aa0ab9dd2d45a1cac46620ffb8d1d2e765c
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Apr 6 13:45:42 2023 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Apr 6 13:45:42 2023 +0200
WHATS_NEW: update
---
WHATS_NEW | 2 ++
1 file changed, 2 insertions(+)
diff --git a/WHATS_NEW b/WHATS_NEW
index 6f801828f..2bff3445d 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,7 @@
version 2.03.21 -
=================================
+ Fix activation of vdo-pool for with 0 length headers (converted pools).
+ Avoid printing internal init messages when creation integration devices.
version 2.03.20 - 21st March 2023
=================================
5 months, 4 weeks
main - tests: use less demanding ext4
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=e59e7aa0ab9dd2d45a1...
Commit: e59e7aa0ab9dd2d45a1cac46620ffb8d1d2e765c
Parent: 7b5291a8ed7917a396232024880b252ecf6ab23f
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Apr 6 13:40:16 2023 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Apr 6 13:41:30 2023 +0200
tests: use less demanding ext4
---
test/shell/integrity-caching.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/shell/integrity-caching.sh b/test/shell/integrity-caching.sh
index 158a31932..5539ac575 100644
--- a/test/shell/integrity-caching.sh
+++ b/test/shell/integrity-caching.sh
@@ -49,7 +49,7 @@ _prepare_vg() {
}
_test_fs_with_read_repair() {
- mkfs.xfs -f -s size=4096 "$DM_DEV_DIR/$vg/$lv1"
+ mkfs.ext4 "$DM_DEV_DIR/$vg/$lv1"
mount "$DM_DEV_DIR/$vg/$lv1" $mnt
@@ -103,7 +103,7 @@ _test_fs_with_read_repair() {
}
_add_new_data_to_mnt() {
- mkfs.xfs -f -s size=4096 "$DM_DEV_DIR/$vg/$lv1"
+ mkfs.ext4 "$DM_DEV_DIR/$vg/$lv1"
mount "$DM_DEV_DIR/$vg/$lv1" $mnt
5 months, 4 weeks
main - tests: lower demand for disk resources
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=7b5291a8ed7917a3962...
Commit: 7b5291a8ed7917a396232024880b252ecf6ab23f
Parent: e8e6347ba3f59cbd2f7e92aa707543b90fa607a3
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Apr 4 14:44:47 2023 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Apr 6 13:34:26 2023 +0200
tests: lower demand for disk resources
Convert test to use a single skeleton and only different pieces
keep in separate tests.
Lower raid disk usage to smaller size and switch to ext4
as way less demanding fileystem.
---
test/shell/vg-raid-takeover-1.sh | 149 ++++++++++++++++++++-------------------
test/shell/vg-raid-takeover-2.sh | 139 +++---------------------------------
test/shell/vg-raid-takeover-3.sh | 133 ++--------------------------------
test/shell/vg-raid-takeover-4.sh | 124 ++------------------------------
4 files changed, 97 insertions(+), 448 deletions(-)
diff --git a/test/shell/vg-raid-takeover-1.sh b/test/shell/vg-raid-takeover-1.sh
index f186606a6..98e043aae 100644
--- a/test/shell/vg-raid-takeover-1.sh
+++ b/test/shell/vg-raid-takeover-1.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
-# Copyright (C) 2015 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2023 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
@@ -16,13 +16,10 @@ test_description='Test VG takeover with raid LVs'
SKIP_WITH_LVMLOCKD=1
SKIP_WITH_LVMPOLLD=1
-print_lvmlocal() {
- { echo "local {"; printf "%s\n" "$@"; echo "}"; } >"$LVMLOCAL"
-}
-
. lib/inittest
-aux prepare_devs 3 1024
+aux have_raid 1 9 0 || skip
+aux prepare_devs ${PREPARE_DEVS-3}
SIDFILE="etc/lvm_test.conf"
LVMLOCAL="etc/lvmlocal.conf"
@@ -30,6 +27,10 @@ LVMLOCAL="etc/lvmlocal.conf"
DFDIR="$LVM_SYSTEM_DIR/devices"
DF="$DFDIR/system.devices"
+print_lvmlocal() {
+ { echo "local {"; printf "%s\n" "$@"; echo "}"; } >"$LVMLOCAL"
+}
+
# Avoid system id validation in the devices file
# which gets in the way of the test switching the
# local system id.
@@ -40,54 +41,74 @@ clear_df_systemid() {
fi
}
+test_check_mount() {
+ pvs -o+missing
+ vgs -o+systemid,partial $vg
+ lvs -a -o+devices $vg
+
+ mount "$DM_DEV_DIR/$vg/$lv1" "$mount_dir"
+ diff pattern1 "$mount_dir/pattern1a"
+ diff pattern1 "$mount_dir/pattern1c"
+ umount "$mount_dir"
+ fsck -n "$DM_DEV_DIR/$vg/$lv1"
+
+ mount "$DM_DEV_DIR/$vg/$lv2" "$mount_dir"
+ diff pattern1 "$mount_dir/pattern1a"
+ diff pattern1 "$mount_dir/pattern1c"
+ umount "$mount_dir"
+ fsck -n "$DM_DEV_DIR/$vg/$lv2"
+}
+
+
SID1=sidfoofile1
SID2=sidfoofile2
echo "$SID1" > "$SIDFILE"
clear_df_systemid
aux lvmconf "global/system_id_source = file" \
- "global/system_id_file = \"$SIDFILE\""
+ "global/system_id_file = \"$SIDFILE\""
vgcreate $vg "$dev1" "$dev2" "$dev3"
vgs -o+systemid,partial $vg
check vg_field $vg systemid "$SID1"
-lvcreate --type raid1 -L 400 -m1 -n $lv1 $vg "$dev1" "$dev2"
-lvcreate --type raid1 -L 400 -m2 -n $lv2 $vg "$dev1" "$dev2" "$dev3"
+lvcreate --type raid1 -L 8 -m1 -n $lv1 $vg "$dev1" "$dev2"
+lvcreate --type raid1 -L 8 -m2 -n $lv2 $vg "$dev1" "$dev2" "$dev3"
# give some time for raid init
-sleep 2
+aux wait_for_sync $vg $lv1
+aux wait_for_sync $vg $lv2
lvs -a -o+devices $vg
-mkfs.xfs -f "$DM_DEV_DIR/$vg/$lv1"
-mkfs.xfs -f "$DM_DEV_DIR/$vg/$lv2"
+mkfs.ext4 "$DM_DEV_DIR/$vg/$lv1"
+mkfs.ext4 "$DM_DEV_DIR/$vg/$lv2"
dd if=/dev/urandom of=pattern1 bs=512K count=1
mount_dir="mnt_takeover"
mkdir -p "$mount_dir"
-mount "$DM_DEV_DIR/$vg/$lv1" $mount_dir
-dd if=/dev/zero of=$mount_dir/file1 bs=4096 count=1024
-cp pattern1 $mount_dir/pattern1a
-cp pattern1 $mount_dir/pattern1b
-umount $mount_dir
+mount "$DM_DEV_DIR/$vg/$lv1" "$mount_dir"
+dd if=/dev/zero of="$mount_dir/file1" bs=1M count=4 oflag=direct
+cp pattern1 "$mount_dir/pattern1a"
+cp pattern1 "$mount_dir/pattern1b"
+umount "$mount_dir"
-mount "$DM_DEV_DIR/$vg/$lv2" $mount_dir
-dd if=/dev/zero of=$mount_dir/file1 bs=4096 count=1024
-cp pattern1 $mount_dir/pattern1a
-cp pattern1 $mount_dir/pattern1b
-umount $mount_dir
+mount "$DM_DEV_DIR/$vg/$lv2" "$mount_dir"
+dd if=/dev/zero of="$mount_dir/file1" bs=1M count=4 oflag=direct
+cp pattern1 "$mount_dir/pattern1a"
+cp pattern1 "$mount_dir/pattern1b"
+umount "$mount_dir"
vgchange -an $vg
# make the vg foreign
-vgchange --yes --systemid $SID2 $vg
+vgchange --yes --systemid "$SID2" $vg
not vgs $vg
# make one dev missing
aux hide_dev "$dev1"
# take over the vg, like cluster failover would do
-vgchange --majoritypvs --config "local/extra_system_ids=[\"${SID2}\"]" --systemid $SID1 $vg
+vgchange --majoritypvs --config "local/extra_system_ids=[\"${SID2}\"]" --systemid "$SID1" $vg
pvs -o+missing
vgs -o+systemid,partial $vg
lvs -a -o+devices $vg
@@ -95,28 +116,37 @@ lvs -a -o+devices $vg
lvchange -ay --activationmode degraded $vg/$lv1
lvchange -ay --activationmode degraded $vg/$lv2
-mount "$DM_DEV_DIR/$vg/$lv1" $mount_dir
-dd of=/dev/null if=$mount_dir/file1 bs=4096 count=1024
-diff pattern1 $mount_dir/pattern1a
-diff pattern1 $mount_dir/pattern1b
-rm $mount_dir/pattern1b
-rm $mount_dir/file1
-cp pattern1 $mount_dir/pattern1c
-umount $mount_dir
-
-mount "$DM_DEV_DIR/$vg/$lv2" $mount_dir
-dd of=/dev/null if=$mount_dir/file1 bs=4096 count=1024
-diff pattern1 $mount_dir/pattern1a
-diff pattern1 $mount_dir/pattern1b
-rm $mount_dir/pattern1b
-rm $mount_dir/file1
-cp pattern1 $mount_dir/pattern1c
-umount $mount_dir
+mount "$DM_DEV_DIR/$vg/$lv1" "$mount_dir"
+dd of=/dev/null if="$mount_dir/file1" bs=1M count=4
+diff pattern1 "$mount_dir/pattern1a"
+diff pattern1 "$mount_dir/pattern1b"
+rm "$mount_dir/pattern1b"
+rm "$mount_dir/file1"
+cp pattern1 "$mount_dir/pattern1c"
+umount "$mount_dir"
+
+mount "$DM_DEV_DIR/$vg/$lv2" "$mount_dir"
+dd of=/dev/null if="$mount_dir/file1" bs=1M count=4
+diff pattern1 "$mount_dir/pattern1a"
+diff pattern1 "$mount_dir/pattern1b"
+rm "$mount_dir/pattern1b"
+rm "$mount_dir/file1"
+cp pattern1 "$mount_dir/pattern1c"
+umount "$mount_dir"
pvs -o+missing
vgs -o+systemid,partial $vg
lvs -a -o+devices $vg
+
+
+#----------------------------------------------------------
+# test will continue differently when var OTHER_TEST is set
+#----------------------------------------------------------
+test -n "${CONTINUE_ELSEWHERE-}" && return 0
+
+
+
# fails because the missing dev is used by lvs
not vgreduce --removemissing $vg
# works because lvs can be used with missing leg
@@ -131,19 +161,9 @@ lvconvert --repair $vg/$lv1
# fails to find another disk to use to repair
not lvconvert -y --repair $vg/$lv2
-pvs -o+missing
-vgs -o+systemid,partial $vg
-lvs -a -o+devices $vg
-mount "$DM_DEV_DIR/$vg/$lv1" $mount_dir
-diff pattern1 $mount_dir/pattern1a
-diff pattern1 $mount_dir/pattern1c
-umount $mount_dir
+test_check_mount
-mount "$DM_DEV_DIR/$vg/$lv2" $mount_dir
-diff pattern1 $mount_dir/pattern1a
-diff pattern1 $mount_dir/pattern1c
-umount $mount_dir
aux unhide_dev "$dev1"
@@ -162,36 +182,21 @@ lvconvert -y -m-1 $vg/$lv2
# remove the failed unused leg, leaving 1 leg
lvconvert -y -m-1 $vg/$lv1
-pvs -o+missing
-vgs -o+systemid,partial,partial $vg
-lvs -a -o+devices $vg
-mount "$DM_DEV_DIR/$vg/$lv1" $mount_dir
-diff pattern1 $mount_dir/pattern1a
-diff pattern1 $mount_dir/pattern1c
-umount $mount_dir
+test_check_mount
-mount "$DM_DEV_DIR/$vg/$lv2" $mount_dir
-diff pattern1 $mount_dir/pattern1a
-diff pattern1 $mount_dir/pattern1c
-umount $mount_dir
vgextend $vg "$dev1"
lvconvert -y -m+1 $vg/$lv1 "$dev1"
lvconvert -y -m+1 $vg/$lv2 "$dev1"
# let raid sync new leg
-sleep 3
+aux wait_for_sync $vg $lv1
+aux wait_for_sync $vg $lv2
+
-mount "$DM_DEV_DIR/$vg/$lv1" $mount_dir
-diff pattern1 $mount_dir/pattern1a
-diff pattern1 $mount_dir/pattern1c
-umount $mount_dir
+test_check_mount
-mount "$DM_DEV_DIR/$vg/$lv2" $mount_dir
-diff pattern1 $mount_dir/pattern1a
-diff pattern1 $mount_dir/pattern1c
-umount $mount_dir
vgchange -an $vg
vgremove -f $vg
diff --git a/test/shell/vg-raid-takeover-2.sh b/test/shell/vg-raid-takeover-2.sh
index e0b46dece..afc8db432 100644
--- a/test/shell/vg-raid-takeover-2.sh
+++ b/test/shell/vg-raid-takeover-2.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
-# Copyright (C) 2015 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2023 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
@@ -12,110 +12,10 @@
test_description='Test VG takeover with raid LVs'
-# test does not apply to lvmlockd
-SKIP_WITH_LVMLOCKD=1
-SKIP_WITH_LVMPOLLD=1
-
-print_lvmlocal() {
- { echo "local {"; printf "%s\n" "$@"; echo "}"; } >"$LVMLOCAL"
-}
-
-. lib/inittest
-
-aux prepare_devs 4 1024
-
-SIDFILE="etc/lvm_test.conf"
-LVMLOCAL="etc/lvmlocal.conf"
-
-DFDIR="$LVM_SYSTEM_DIR/devices"
-DF="$DFDIR/system.devices"
-
-# Avoid system id validation in the devices file
-# which gets in the way of the test switching the
-# local system id.
-clear_df_systemid() {
- if [[ -f $DF ]]; then
- sed -e "s|SYSTEMID=.||" "$DF" > tmpdf
- cp tmpdf $DF
- fi
-}
-
-SID1=sidfoofile1
-SID2=sidfoofile2
-echo "$SID1" > "$SIDFILE"
-clear_df_systemid
-aux lvmconf "global/system_id_source = file" \
- "global/system_id_file = \"$SIDFILE\""
-vgcreate $vg "$dev1" "$dev2" "$dev3"
-vgs -o+systemid,partial $vg
-check vg_field $vg systemid "$SID1"
-
-lvcreate --type raid1 -L 400 -m1 -n $lv1 $vg "$dev1" "$dev2"
-lvcreate --type raid1 -L 400 -m2 -n $lv2 $vg "$dev1" "$dev2" "$dev3"
-
-# give some time for raid init
-sleep 2
-lvs -a -o+devices $vg
-
-mkfs.xfs -f "$DM_DEV_DIR/$vg/$lv1"
-mkfs.xfs -f "$DM_DEV_DIR/$vg/$lv2"
-
-dd if=/dev/urandom of=pattern1 bs=512K count=1
-
-mount_dir="mnt_takeover"
-mkdir -p "$mount_dir"
-
-mount "$DM_DEV_DIR/$vg/$lv1" $mount_dir
-dd if=/dev/zero of=$mount_dir/file1 bs=4096 count=1024
-cp pattern1 $mount_dir/pattern1a
-cp pattern1 $mount_dir/pattern1b
-umount $mount_dir
+CONTINUE_ELSEWHERE=y
+PREPARE_DEVS=4
-mount "$DM_DEV_DIR/$vg/$lv2" $mount_dir
-dd if=/dev/zero of=$mount_dir/file1 bs=4096 count=1024
-cp pattern1 $mount_dir/pattern1a
-cp pattern1 $mount_dir/pattern1b
-umount $mount_dir
-
-vgchange -an $vg
-
-# make the vg foreign
-vgchange --yes --systemid $SID2 $vg
-not vgs $vg
-
-# make one dev missing
-aux hide_dev "$dev1"
-
-# take over the vg, like cluster failover would do
-vgchange --majoritypvs --config "local/extra_system_ids=[\"${SID2}\"]" --systemid $SID1 $vg
-pvs -o+missing
-vgs -o+systemid,partial $vg
-lvs -a -o+devices $vg
-
-lvchange -ay --activationmode degraded $vg/$lv1
-lvchange -ay --activationmode degraded $vg/$lv2
-
-mount "$DM_DEV_DIR/$vg/$lv1" $mount_dir
-dd of=/dev/null if=$mount_dir/file1 bs=4096 count=1024
-diff pattern1 $mount_dir/pattern1a
-diff pattern1 $mount_dir/pattern1b
-rm $mount_dir/pattern1b
-rm $mount_dir/file1
-cp pattern1 $mount_dir/pattern1c
-umount $mount_dir
-
-mount "$DM_DEV_DIR/$vg/$lv2" $mount_dir
-dd of=/dev/null if=$mount_dir/file1 bs=4096 count=1024
-diff pattern1 $mount_dir/pattern1a
-diff pattern1 $mount_dir/pattern1b
-rm $mount_dir/pattern1b
-rm $mount_dir/file1
-cp pattern1 $mount_dir/pattern1c
-umount $mount_dir
-
-pvs -o+missing
-vgs -o+systemid,partial $vg
-lvs -a -o+devices $vg
+. ./shell/vg-raid-takeover-1.sh
# fails because the missing dev is used by lvs
not vgreduce --removemissing $vg
@@ -147,42 +47,19 @@ vgextend $vg "$dev4"
lvconvert -y --repair $vg/$lv2
-pvs -o+missing
-vgs -o+systemid,partial $vg
-lvs -a -o+devices $vg
-mount "$DM_DEV_DIR/$vg/$lv1" $mount_dir
-diff pattern1 $mount_dir/pattern1a
-diff pattern1 $mount_dir/pattern1c
-umount $mount_dir
+test_check_mount
-mount "$DM_DEV_DIR/$vg/$lv2" $mount_dir
-diff pattern1 $mount_dir/pattern1a
-diff pattern1 $mount_dir/pattern1c
-umount $mount_dir
# let the new legs sync
-sleep 3
+aux wait_for_sync $vg $lv1
+aux wait_for_sync $vg $lv2
vgck --updatemetadata $vg
-pvs -o+missing
-vgs -o+systemid,partial $vg
-lvs -a -o+devices $vg
-
-mount "$DM_DEV_DIR/$vg/$lv1" $mount_dir
-diff pattern1 $mount_dir/pattern1a
-diff pattern1 $mount_dir/pattern1c
-umount $mount_dir
-mount "$DM_DEV_DIR/$vg/$lv2" $mount_dir
-diff pattern1 $mount_dir/pattern1a
-diff pattern1 $mount_dir/pattern1c
-umount $mount_dir
+test_check_mount
-pvs -o+missing
-vgs -o+systemid,partial $vg
-lvs -a -o+devices $vg
vgchange -an $vg
vgremove -f $vg
diff --git a/test/shell/vg-raid-takeover-3.sh b/test/shell/vg-raid-takeover-3.sh
index 5df53d1d7..0050c1918 100644
--- a/test/shell/vg-raid-takeover-3.sh
+++ b/test/shell/vg-raid-takeover-3.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
-# Copyright (C) 2015 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2023 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
@@ -12,111 +12,11 @@
test_description='Test VG takeover with raid LVs'
-# test does not apply to lvmlockd
-SKIP_WITH_LVMLOCKD=1
-SKIP_WITH_LVMPOLLD=1
-
-print_lvmlocal() {
- { echo "local {"; printf "%s\n" "$@"; echo "}"; } >"$LVMLOCAL"
-}
-
-. lib/inittest
-
-aux prepare_devs 3 1024
-
-SIDFILE="etc/lvm_test.conf"
-LVMLOCAL="etc/lvmlocal.conf"
-
-DFDIR="$LVM_SYSTEM_DIR/devices"
-DF="$DFDIR/system.devices"
-
-# Avoid system id validation in the devices file
-# which gets in the way of the test switching the
-# local system id.
-clear_df_systemid() {
- if [[ -f $DF ]]; then
- sed -e "s|SYSTEMID=.||" "$DF" > tmpdf
- cp tmpdf $DF
- fi
-}
-
-SID1=sidfoofile1
-SID2=sidfoofile2
-echo "$SID1" > "$SIDFILE"
-clear_df_systemid
-aux lvmconf "global/system_id_source = file" \
- "global/system_id_file = \"$SIDFILE\""
-vgcreate $vg "$dev1" "$dev2" "$dev3"
-vgs -o+systemid,partial $vg
-check vg_field $vg systemid "$SID1"
-
-lvcreate --type raid1 -L 400 -m1 -n $lv1 $vg "$dev1" "$dev2"
-lvcreate --type raid1 -L 400 -m2 -n $lv2 $vg "$dev1" "$dev2" "$dev3"
-
-# give some time for raid init
-sleep 2
-lvs -a -o+devices $vg
-
-mkfs.xfs -f "$DM_DEV_DIR/$vg/$lv1"
-mkfs.xfs -f "$DM_DEV_DIR/$vg/$lv2"
-
-dd if=/dev/urandom of=pattern1 bs=512K count=1
-
-mount_dir="mnt_takeover"
-mkdir -p "$mount_dir"
-
-mount "$DM_DEV_DIR/$vg/$lv1" $mount_dir
-dd if=/dev/zero of=$mount_dir/file1 bs=4096 count=1024
-cp pattern1 $mount_dir/pattern1a
-cp pattern1 $mount_dir/pattern1b
-umount $mount_dir
-
-mount "$DM_DEV_DIR/$vg/$lv2" $mount_dir
-dd if=/dev/zero of=$mount_dir/file1 bs=4096 count=1024
-cp pattern1 $mount_dir/pattern1a
-cp pattern1 $mount_dir/pattern1b
-umount $mount_dir
-
-vgchange -an $vg
-
-# make the vg foreign
-vgchange --yes --systemid $SID2 $vg
-not vgs $vg
-
-# make one dev missing
-aux hide_dev "$dev1"
-
-# take over the vg, like cluster failover would do
-vgchange --majoritypvs --config "local/extra_system_ids=[\"${SID2}\"]" --systemid $SID1 $vg
-pvs -o+missing
-vgs -o+systemid,partial $vg
-lvs -a -o+devices $vg
-
-lvchange -ay --activationmode degraded $vg/$lv1
-lvchange -ay --activationmode degraded $vg/$lv2
-
-mount "$DM_DEV_DIR/$vg/$lv1" $mount_dir
-dd of=/dev/null if=$mount_dir/file1 bs=4096 count=1024
-diff pattern1 $mount_dir/pattern1a
-diff pattern1 $mount_dir/pattern1b
-rm $mount_dir/pattern1b
-rm $mount_dir/file1
-cp pattern1 $mount_dir/pattern1c
-umount $mount_dir
-
-mount "$DM_DEV_DIR/$vg/$lv2" $mount_dir
-dd of=/dev/null if=$mount_dir/file1 bs=4096 count=1024
-diff pattern1 $mount_dir/pattern1a
-diff pattern1 $mount_dir/pattern1b
-rm $mount_dir/pattern1b
-rm $mount_dir/file1
-cp pattern1 $mount_dir/pattern1c
-umount $mount_dir
+CONTINUE_ELSEWHERE=y
-pvs -o+missing
-vgs -o+systemid,partial $vg
-lvs -a -o+devices $vg
+. ./shell/vg-raid-takeover-1.sh
+#-----------------------
# replaces dev1 with dev3
lvconvert -y --repair $vg/$lv1
@@ -124,24 +24,15 @@ lvconvert -y --repair $vg/$lv1
# but that's not allowed until the missing disk is removed from the vg
not lvconvert -y -m-1 $vg/$lv2
vgreduce --removemissing --mirrorsonly --force $vg
+
pvs -o+missing
vgs -o+systemid,partial $vg
lvs -a -o+devices $vg
lvconvert -y -m-1 $vg/$lv2
-pvs -o+missing
-vgs -o+systemid,partial $vg
-lvs -a -o+devices $vg
-mount "$DM_DEV_DIR/$vg/$lv1" $mount_dir
-diff pattern1 $mount_dir/pattern1a
-diff pattern1 $mount_dir/pattern1c
-umount $mount_dir
+test_check_mount
-mount "$DM_DEV_DIR/$vg/$lv2" $mount_dir
-diff pattern1 $mount_dir/pattern1a
-diff pattern1 $mount_dir/pattern1c
-umount $mount_dir
aux unhide_dev "$dev1"
@@ -153,19 +44,9 @@ vgextend $vg "$dev1"
pvs -o+missing
lvconvert -y -m+1 $vg/$lv2 "$dev1"
-pvs -o+missing
-vgs -o+systemid,partial $vg
-lvs -a -o+devices $vg
-mount "$DM_DEV_DIR/$vg/$lv1" $mount_dir
-diff pattern1 $mount_dir/pattern1a
-diff pattern1 $mount_dir/pattern1c
-umount $mount_dir
+test_check_mount
-mount "$DM_DEV_DIR/$vg/$lv2" $mount_dir
-diff pattern1 $mount_dir/pattern1a
-diff pattern1 $mount_dir/pattern1c
-umount $mount_dir
vgchange -an $vg
vgremove -f $vg
diff --git a/test/shell/vg-raid-takeover-4.sh b/test/shell/vg-raid-takeover-4.sh
index bdb78a215..8e29f2d7b 100644
--- a/test/shell/vg-raid-takeover-4.sh
+++ b/test/shell/vg-raid-takeover-4.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
-# Copyright (C) 2015 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2023 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
@@ -12,110 +12,10 @@
test_description='Test VG takeover with raid LVs'
-# test does not apply to lvmlockd
-SKIP_WITH_LVMLOCKD=1
-SKIP_WITH_LVMPOLLD=1
+CONTINUE_ELSEWHERE=y
+PREPARE_DEVS=4
-print_lvmlocal() {
- { echo "local {"; printf "%s\n" "$@"; echo "}"; } >"$LVMLOCAL"
-}
-
-. lib/inittest
-
-aux prepare_devs 4 1024
-
-SIDFILE="etc/lvm_test.conf"
-LVMLOCAL="etc/lvmlocal.conf"
-
-DFDIR="$LVM_SYSTEM_DIR/devices"
-DF="$DFDIR/system.devices"
-
-# Avoid system id validation in the devices file
-# which gets in the way of the test switching the
-# local system id.
-clear_df_systemid() {
- if [[ -f $DF ]]; then
- sed -e "s|SYSTEMID=.||" "$DF" > tmpdf
- cp tmpdf $DF
- fi
-}
-
-SID1=sidfoofile1
-SID2=sidfoofile2
-echo "$SID1" > "$SIDFILE"
-clear_df_systemid
-aux lvmconf "global/system_id_source = file" \
- "global/system_id_file = \"$SIDFILE\""
-vgcreate $vg "$dev1" "$dev2" "$dev3"
-vgs -o+systemid,partial $vg
-check vg_field $vg systemid "$SID1"
-
-lvcreate --type raid1 -L 400 -m1 -n $lv1 $vg "$dev1" "$dev2"
-lvcreate --type raid1 -L 400 -m2 -n $lv2 $vg "$dev1" "$dev2" "$dev3"
-
-# give some time for raid init
-sleep 2
-lvs -a -o+devices $vg
-
-mkfs.xfs -f "$DM_DEV_DIR/$vg/$lv1"
-mkfs.xfs -f "$DM_DEV_DIR/$vg/$lv2"
-
-dd if=/dev/urandom of=pattern1 bs=512K count=1
-
-mount_dir="mnt_takeover"
-mkdir -p "$mount_dir"
-
-mount "$DM_DEV_DIR/$vg/$lv1" $mount_dir
-dd if=/dev/zero of=$mount_dir/file1 bs=4096 count=1024
-cp pattern1 $mount_dir/pattern1a
-cp pattern1 $mount_dir/pattern1b
-umount $mount_dir
-
-mount "$DM_DEV_DIR/$vg/$lv2" $mount_dir
-dd if=/dev/zero of=$mount_dir/file1 bs=4096 count=1024
-cp pattern1 $mount_dir/pattern1a
-cp pattern1 $mount_dir/pattern1b
-umount $mount_dir
-
-vgchange -an $vg
-
-# make the vg foreign
-vgchange --yes --systemid $SID2 $vg
-not vgs $vg
-
-# make one dev missing
-aux hide_dev "$dev1"
-
-# take over the vg, like cluster failover would do
-vgchange --majoritypvs --config "local/extra_system_ids=[\"${SID2}\"]" --systemid $SID1 $vg
-pvs -o+missing
-vgs -o+systemid,partial $vg
-lvs -a -o+devices $vg
-
-lvchange -ay --activationmode degraded $vg/$lv1
-lvchange -ay --activationmode degraded $vg/$lv2
-
-mount "$DM_DEV_DIR/$vg/$lv1" $mount_dir
-dd of=/dev/null if=$mount_dir/file1 bs=4096 count=1024
-diff pattern1 $mount_dir/pattern1a
-diff pattern1 $mount_dir/pattern1b
-rm $mount_dir/pattern1b
-rm $mount_dir/file1
-cp pattern1 $mount_dir/pattern1c
-umount $mount_dir
-
-mount "$DM_DEV_DIR/$vg/$lv2" $mount_dir
-dd of=/dev/null if=$mount_dir/file1 bs=4096 count=1024
-diff pattern1 $mount_dir/pattern1a
-diff pattern1 $mount_dir/pattern1b
-rm $mount_dir/pattern1b
-rm $mount_dir/file1
-cp pattern1 $mount_dir/pattern1c
-umount $mount_dir
-
-pvs -o+missing
-vgs -o+systemid,partial $vg
-lvs -a -o+devices $vg
+. ./shell/vg-raid-takeover-1.sh
# unhide_dev
# the device reappears before the LVs are repaired
@@ -129,23 +29,9 @@ lvs -a -o+devices $vg
vgextend --restoremissing $vg "$dev1"
-pvs -o+missing
-vgs -o+systemid,partial $vg
-lvs -a -o+devices $vg
-mount "$DM_DEV_DIR/$vg/$lv1" $mount_dir
-diff pattern1 $mount_dir/pattern1a
-diff pattern1 $mount_dir/pattern1c
-umount $mount_dir
+test_check_mount
-mount "$DM_DEV_DIR/$vg/$lv2" $mount_dir
-diff pattern1 $mount_dir/pattern1a
-diff pattern1 $mount_dir/pattern1c
-umount $mount_dir
-
-pvs -o+missing
-vgs -o+systemid,partial $vg
-lvs -a -o+devices $vg
vgchange -an $vg
vgremove -f $vg
5 months, 4 weeks
main - vdo: use fixed size vdopool wrapper
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=e8e6347ba3f59cbd2f7...
Commit: e8e6347ba3f59cbd2f7e92aa707543b90fa607a3
Parent: 334117ee00aa6751ff7589b983497e1b7eee9d76
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Mar 6 14:52:59 2023 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Apr 6 11:06:04 2023 +0200
vdo: use fixed size vdopool wrapper
Instead of using size of 'empty header' in vdopool use fixed size 4K
for a 'wrappeing' vdo-pool device.
This fixes the issue when user tried to activate vdo-pool after
a conversion from vdo managed device with 'vgchange -ay' - where
this command activated all LVs with 'vdo-pool' wrapping device as well,
but this converted pool uses 0-length header.
This 4k size should usually prevent other tools like 'blkid' recognize
such device as anything - so it shouldn't cause any problems with
duplicate indentification of devices.
---
lib/activate/dev_manager.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index c4bd6ab7b..ec642f421 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -3115,7 +3115,7 @@ static int _add_layer_target_to_dtree(struct dev_manager *dm,
/* Add linear mapping over layered LV */
/* From VDO layer expose ONLY vdo pool header, we would need to use virtual size otherwise */
- if (!add_linear_area_to_dtree(dnode, lv_is_vdo_pool(lv) ? first_seg(lv)->vdo_pool_header_size : lv->size,
+ if (!add_linear_area_to_dtree(dnode, lv_is_vdo_pool(lv) ? 8 : lv->size,
lv->vg->extent_size,
lv->vg->cmd->use_linear_target,
lv->vg->name, lv->name) ||
5 months, 4 weeks
main - cleanup: rename function
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=334117ee00aa6751ff7...
Commit: 334117ee00aa6751ff7589b983497e1b7eee9d76
Parent: 1fb3e08033570365580b576777e312d2f9c2d86d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Mar 6 14:52:28 2023 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Apr 6 11:06:04 2023 +0200
cleanup: rename function
Rename _thin_lv_has_device_id and use common function naming
with _lv_has_thin_device_id().
---
lib/activate/dev_manager.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index 689305f7b..c4bd6ab7b 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -1070,7 +1070,7 @@ bad:
return r;
}
-static int _thin_lv_has_device_id(struct dm_pool *mem, const struct logical_volume *lv,
+static int _lv_has_thin_device_id(struct dm_pool *mem, const struct logical_volume *lv,
const char *layer, unsigned device_id)
{
char *dlid;
@@ -3529,7 +3529,7 @@ static int _add_new_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree,
*/
if ((dinfo = _cached_dm_info(dm->mem, dtree, lv, NULL))) {
/* Merging origin LV is present, check if mergins is already running. */
- if ((seg_is_thin_volume(seg) && _thin_lv_has_device_id(dm->mem, lv, NULL, seg->device_id)) ||
+ if ((seg_is_thin_volume(seg) && _lv_has_thin_device_id(dm->mem, lv, NULL, seg->device_id)) ||
(!seg_is_thin_volume(seg) && lv_has_target_type(dm->mem, lv, NULL, TARGET_NAME_SNAPSHOT_MERGE))) {
log_debug_activation("Merging of snapshot volume %s to origin %s is in progress.",
display_lvname(seg->lv), display_lvname(seg->lv));
5 months, 4 weeks