main - WHATS_NEW: update
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=0a5712ada4753cd034d...
Commit: 0a5712ada4753cd034d862389e6e91af387c406f
Parent: 9756824f6447fb8c6096760e802d4f616929f710
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jun 23 18:07:31 2023 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 23 18:08:10 2023 +0200
WHATS_NEW: update
---
WHATS_NEW | 1 +
1 file changed, 1 insertion(+)
diff --git a/WHATS_NEW b/WHATS_NEW
index cb38ba72e..de40d239d 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
version 2.03.22 -
=================================
+ Add lvm.conf thin_restore and cache_restore settings.
Enhance lvm_import_vdo and use snapshot when converting VDO volume.
Fix parsed of VDO metadata.
Fix failing -S|--select for non-reporting cmds if using LV info/status fields.
11 months
main - make: generate
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=9756824f6447fb8c609...
Commit: 9756824f6447fb8c6096760e802d4f616929f710
Parent: 46fe47b8e0ad8069bb3736d2aa3e78befdccb38d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jun 23 11:39:46 2023 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 23 18:08:10 2023 +0200
make: generate
---
conf/example.conf.in | 28 +++++++++++++++++++++++++++-
man/lvcreate.8_pregen | 6 ++++++
2 files changed, 33 insertions(+), 1 deletion(-)
diff --git a/conf/example.conf.in b/conf/example.conf.in
index 0b9b06a17..35837c013 100644
--- a/conf/example.conf.in
+++ b/conf/example.conf.in
@@ -1201,7 +1201,7 @@ global {
# Configuration option global/thin_check_executable.
# The full path to the thin_check command.
- # LVM uses this command to check that a thin metadata device is in a
+ # LVM uses this command to check that a thin pool metadata device is in a
# usable state. When a thin pool is activated and after it is
# deactivated, this command is run. Activation will only proceed if
# the command has an exit status of 0. Set to "" to skip this check.
@@ -1225,6 +1225,14 @@ global {
# This configuration option has an automatic default value.
# thin_repair_executable = "@THIN_REPAIR_CMD@"
+ # Configuration option global/thin_restore_executable.
+ # The full path to the thin_restore command.
+ # LVM uses this command to restore generated data for a thin pool metadata device.
+ # Also see thin_restore_options.
+ # (See package device-mapper-persistent-data or thin-provisioning-tools)
+ # This configuration option has an automatic default value.
+ # thin_restore_executable = "@THIN_RESTORE_CMD@"
+
# Configuration option global/thin_check_options.
# List of options passed to the thin_check command.
# With thin_check version 2.1 or newer you can add the option
@@ -1239,6 +1247,11 @@ global {
# This configuration option has an automatic default value.
# thin_repair_options = [ "" ]
+ # Configuration option global/thin_restore_options.
+ # List of options passed to the thin_restore command.
+ # This configuration option has an automatic default value.
+ # thin_restore_options = [ "" ]
+
# Configuration option global/thin_disabled_features.
# Features to not use in the thin driver.
# This can be helpful for testing, or to avoid using a feature that is
@@ -1287,6 +1300,14 @@ global {
# This configuration option has an automatic default value.
# cache_repair_executable = "@CACHE_REPAIR_CMD@"
+ # Configuration option global/cache_restore_executable.
+ # The full path to the cache_restore command.
+ # LVM uses this command to restore generated data for a cache metadata device.
+ # Also see cache_restore_options.
+ # (See package device-mapper-persistent-data or thin-provisioning-tools)
+ # This configuration option has an automatic default value.
+ # cache_restore_executable = "@CACHE_RESTORE_CMD@"
+
# Configuration option global/cache_check_options.
# List of options passed to the cache_check command.
# With cache_check version 5.0 or newer you should include the option
@@ -1299,6 +1320,11 @@ global {
# This configuration option has an automatic default value.
# cache_repair_options = [ "" ]
+ # Configuration option global/cache_restore_options.
+ # List of options passed to the cache_restore command.
+ # This configuration option has an automatic default value.
+ # cache_restore_options = [ "" ]
+
# Configuration option global/vdo_format_executable.
# The full path to the vdoformat command.
# LVM uses this command to initial data volume for VDO type logical volume
diff --git a/man/lvcreate.8_pregen b/man/lvcreate.8_pregen
index 528a9db9c..27a93d890 100644
--- a/man/lvcreate.8_pregen
+++ b/man/lvcreate.8_pregen
@@ -491,6 +491,8 @@ Create a thin LV that is a snapshot of an existing thin LV.
[ \fB--type thin\fP ] (implied)
.br
.br
+[ \fB-T\fP|\fB--thin\fP ]
+.br
[ COMMON_OPTIONS ]
.ad b
.RE
@@ -1917,6 +1919,8 @@ Create a thin LV that is a snapshot of an existing thin LV.
.ad l
[ \fB-T\fP|\fB--thin\fP ]
.br
+[ \fB-s\fP|\fB--snapshot\fP ]
+.br
[ COMMON_OPTIONS ]
.ad b
.RE
@@ -1937,6 +1941,8 @@ Create a thin LV that is a snapshot of an existing thin LV.
[ \fB--type thin\fP ] (implied)
.br
.br
+[ \fB-s\fP|\fB--snapshot\fP ]
+.br
[ COMMON_OPTIONS ]
.ad b
.RE
11 months
main - debug: add backtraces
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=46fe47b8e0ad8069bb3...
Commit: 46fe47b8e0ad8069bb3736d2aa3e78befdccb38d
Parent: a1d5fba666ccc6f3189d492ba01896f79cf6176f
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jun 23 16:04:55 2023 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 23 18:08:03 2023 +0200
debug: add backtraces
---
lib/config/config.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/config/config.c b/lib/config/config.c
index 5531e431d..1c074abe8 100644
--- a/lib/config/config.c
+++ b/lib/config/config.c
@@ -741,13 +741,13 @@ static struct dm_config_value *_get_def_array_values(struct cmd_context *cmd,
}
/* Proper value always starts with '#'. */
if (token[0] != '#')
- goto bad;
+ goto_bad;
while (token) {
/* Move to type identifier. Error on no char. */
token++;
if (!token[0])
- goto bad;
+ goto_bad;
/* Move to the actual value and decode any "##" into "#". */
p = token + 1;
11 months
main - aux: add configuration for thin_restore and check_restore
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a1d5fba666ccc6f3189...
Commit: a1d5fba666ccc6f3189d492ba01896f79cf6176f
Parent: aed91e49aec64f8375583c7e0febd7b689e69e29
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jun 23 14:43:36 2023 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 23 18:06:22 2023 +0200
aux: add configuration for thin_restore and check_restore
---
test/lib/aux.sh | 2 ++
1 file changed, 2 insertions(+)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 966707f23..6e4a1d74e 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -1552,6 +1552,7 @@ global/abort_on_internal_errors = 1
global/cache_check_executable = "$LVM_TEST_CACHE_CHECK_CMD"
global/cache_dump_executable = "$LVM_TEST_CACHE_DUMP_CMD"
global/cache_repair_executable = "$LVM_TEST_CACHE_REPAIR_CMD"
+global/cache_restore_executable = "$LVM_TEST_CACHE_RESTORE_CMD"
global/detect_internal_vg_cache_corruption = 1
global/fallback_to_local_locking = 0
global/etc = "$LVM_SYSTEM_DIR"
@@ -1561,6 +1562,7 @@ global/si_unit_consistency = 1
global/thin_check_executable = "$LVM_TEST_THIN_CHECK_CMD"
global/thin_dump_executable = "$LVM_TEST_THIN_DUMP_CMD"
global/thin_repair_executable = "$LVM_TEST_THIN_REPAIR_CMD"
+global/thin_restore_executable = "$LVM_TEST_THIN_RESTORE_CMD"
global/use_lvmpolld = $LVM_TEST_LVMPOLLD
global/use_lvmlockd = $LVM_TEST_LVMLOCKD
log/activation = 1
11 months
main - tests: improve test for machine_id
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=aed91e49aec64f83755...
Commit: aed91e49aec64f8375583c7e0febd7b689e69e29
Parent: 39d6a9601fd3d85ac4237a4731297cddfd5ecb1f
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jun 23 14:43:07 2023 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 23 18:06:22 2023 +0200
tests: improve test for machine_id
---
test/shell/system_id.sh | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/test/shell/system_id.sh b/test/shell/system_id.sh
index 14d2c6fd4..486fba1c3 100644
--- a/test/shell/system_id.sh
+++ b/test/shell/system_id.sh
@@ -24,10 +24,13 @@ print_lvmlocal() {
aux prepare_devs 5
-SIDFILE="etc/lvm_test.conf"
-LVMLOCAL="etc/lvmlocal.conf"
+# get lvm.conf location in a form of: etc=path
+eval "$(lvmconfig global/etc)"
-DFDIR="$LVM_SYSTEM_DIR/devices"
+SIDFILE="$etc/lvm_test.conf"
+LVMLOCAL="$etc/lvmlocal.conf"
+
+DFDIR="$etc/devices"
DF="$DFDIR/system.devices"
# Avoid system id validation in the devices file
@@ -50,10 +53,6 @@ vgcreate $vg1 "$dev1"
check vg_field $vg1 systemid "$SID"
vgremove $vg1
-# FIXME - print 'life' config data
-#eval "$(lvmconfig global/etc 2>/dev/null || lvmconfig --type default global/etc)"
-etc="/etc"
-
## machineid
if [ -e "$etc/machine-id" ]; then
SID=$(cat "$etc/machine-id")
@@ -708,4 +707,3 @@ vgs -o+systemid $vg1
check vg_field $vg1 systemid "$SID"
grep "No system ID found from system_id_source" err
vgremove $vg1
-
11 months
main - tests: ensure test defines its own etc dir
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=39d6a9601fd3d85ac42...
Commit: 39d6a9601fd3d85ac4237a4731297cddfd5ecb1f
Parent: 2cb43449ee4c92ae443bd72138fa91bb132aabf7
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Jun 20 21:56:28 2023 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 23 18:06:22 2023 +0200
tests: ensure test defines its own etc dir
Compilation may configure it's own /etc path so ensure the test
has a defined location for access to this dir during testing.
Also prepare machine_id filei (with the use of uuidgen tool)
for the test.
---
test/lib/aux.sh | 3 ++-
test/lib/inittest.sh | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 5a3f0fe44..966707f23 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -1538,7 +1538,7 @@ allocation/vdo_slab_size_mb = 128
allocation/zero_metadata = 0
backup/archive = 0
backup/backup = 0
-devices/cache_dir = "$TESTDIR/etc"
+devices/cache_dir = "$LVM_SYSTEM_DIR"
devices/default_data_alignment = 1
devices/dir = "$DM_DEV_DIR"
devices/md_component_detection = 0
@@ -1554,6 +1554,7 @@ global/cache_dump_executable = "$LVM_TEST_CACHE_DUMP_CMD"
global/cache_repair_executable = "$LVM_TEST_CACHE_REPAIR_CMD"
global/detect_internal_vg_cache_corruption = 1
global/fallback_to_local_locking = 0
+global/etc = "$LVM_SYSTEM_DIR"
global/locking_type=$LVM_TEST_LOCKING
global/notify_dbus = 0
global/si_unit_consistency = 1
diff --git a/test/lib/inittest.sh b/test/lib/inittest.sh
index c41f4c5b4..0becf2215 100644
--- a/test/lib/inittest.sh
+++ b/test/lib/inittest.sh
@@ -124,8 +124,9 @@ DM_ABORT_ON_INTERNAL_ERRORS=${DM_ABORT_ON_INTERNAL_ERRORS:-1}
DM_DEBUG_WITH_LINE_NUMBERS=${DM_DEBUG_WITH_LINE_NUMBERS:-1}
export DM_DEFAULT_NAME_MANGLING_MODE DM_DEV_DIR LVM_SYSTEM_DIR DM_ABORT_ON_INTERNAL_ERRORS
-
mkdir "$LVM_SYSTEM_DIR" "$DM_DEV_DIR"
+MACHINEID=$(uuidgen 2>/dev/null || echo "abcdefabcdefabcdefabcdefabcdefab")
+echo "${MACHINEID//-/}" > "$LVM_SYSTEM_DIR/machine-id" # remove all '-'
if test -n "$LVM_TEST_DEVDIR" ; then
test -d "$LVM_TEST_DEVDIR" || die "Test device directory LVM_TEST_DEVDIR=\"$LVM_TEST_DEVDIR\" is not valid."
DM_DEV_DIR=$LVM_TEST_DEVDIR
11 months
main - tests: fix path to dev dir
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=2cb43449ee4c92ae443...
Commit: 2cb43449ee4c92ae443bd72138fa91bb132aabf7
Parent: fec3087eefc752036a40d854c373132d25ffd30f
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Jun 20 21:19:43 2023 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 23 18:06:22 2023 +0200
tests: fix path to dev dir
Correct some explicit references to /dev and use $DM_DEV_DIR.
---
test/shell/integrity-blocksize.sh | 30 +++++++++++-----------
test/shell/lvconvert-raid-reshape-load.sh | 4 +--
.../lvconvert-raid-reshape-stripes-load-fail.sh | 6 ++---
test/shell/lvconvert-raid-reshape-stripes-load.sh | 4 +--
test/shell/vgchange-pvs-online.sh | 8 +++---
5 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/test/shell/integrity-blocksize.sh b/test/shell/integrity-blocksize.sh
index 9fd77086f..e5d2620a1 100644
--- a/test/shell/integrity-blocksize.sh
+++ b/test/shell/integrity-blocksize.sh
@@ -112,7 +112,7 @@ lvremove -y $vg1/$lv1
# lvconvert on dev512, fsunknown, result 512
lvcreate --type raid1 -m1 -l 8 -n $lv1 $vg1
# clear any residual fs so that libblkid cannot find an fs block size
-aux wipefs_a /dev/$vg1/$lv1
+aux wipefs_a "$DM_DEV_DIR/$vg1/$lv1"
lvconvert --raidintegrity y $vg1/$lv1
pvck --dump metadata "$LOOP1" | grep 'block_size = 512'
lvremove -y $vg1/$lv1
@@ -120,7 +120,7 @@ lvremove -y $vg1/$lv1
# lvconvert on dev4k, fsunknown, result 4k
lvcreate --type raid1 -m1 -l 8 -n $lv1 $vg2
# clear any residual fs so that libblkid cannot find an fs block size
-aux wipefs_a /dev/$vg2/$lv1
+aux wipefs_a "$DM_DEV_DIR//$vg2/$lv1"
lvconvert --raidintegrity y $vg2/$lv1
pvck --dump metadata $LOOP3 | grep 'block_size = 4096'
lvremove -y $vg2/$lv1
@@ -128,20 +128,20 @@ lvremove -y $vg2/$lv1
# lvconvert --bs 4k on dev512, fsunknown, result fail
lvcreate --type raid1 -m1 -l 8 -n $lv1 $vg1
# clear any residual fs so that libblkid cannot find an fs block size
-aux wipefs_a /dev/$vg1/$lv1
+aux wipefs_a "$DM_DEV_DIR//$vg1/$lv1"
not lvconvert --raidintegrity y --raidintegrityblocksize 4096 $vg1/$lv1
lvremove -y $vg1/$lv1
# lvconvert --bs 512 on dev4k, fsunknown, result fail
lvcreate --type raid1 -m1 -l 8 -n $lv1 $vg2
# clear any residual fs so that libblkid cannot find an fs block size
-aux wipefs_a /dev/$vg2/$lv1
+aux wipefs_a "$DM_DEV_DIR//$vg2/$lv1"
not lvconvert --raidintegrity y --raidintegrityblocksize 512 $vg2/$lv1
lvremove -y $vg2/$lv1
# lvconvert on dev512, ext4 1024, result 1024
lvcreate --type raid1 -m1 -l 8 -n $lv1 $vg1
-aux wipefs_a /dev/$vg1/$lv1
+aux wipefs_a "$DM_DEV_DIR//$vg1/$lv1"
mkfs.ext4 "$DM_DEV_DIR/$vg1/$lv1"
blkid -p "$DM_DEV_DIR/$vg1/$lv1" | tee out
grep BLOCK_SIZE=\"1024\" out
@@ -154,7 +154,7 @@ lvremove -y $vg1/$lv1
# lvconvert on dev4k, ext4 4096, result 4096
lvcreate --type raid1 -m1 -l 8 -n $lv1 $vg2
-aux wipefs_a /dev/$vg2/$lv1
+aux wipefs_a "$DM_DEV_DIR/$vg2/$lv1"
mkfs.ext4 "$DM_DEV_DIR/$vg2/$lv1"
blkid -p "$DM_DEV_DIR/$vg2/$lv1" | grep BLOCK_SIZE=\"4096\"
lvconvert --raidintegrity y $vg2/$lv1
@@ -166,7 +166,7 @@ lvremove -y $vg2/$lv1
# lvconvert on dev512, ext4 1024, result 1024 (LV active when adding)
lvcreate --type raid1 -m1 -l 8 -n $lv1 $vg1
-aux wipefs_a /dev/$vg1/$lv1
+aux wipefs_a "$DM_DEV_DIR//$vg1/$lv1"
mkfs.ext4 -b 1024 "$DM_DEV_DIR/$vg1/$lv1"
blkid -p "$DM_DEV_DIR/$vg1/$lv1" | grep BLOCK_SIZE=\"1024\"
lvconvert --raidintegrity y $vg1/$lv1
@@ -178,7 +178,7 @@ lvremove -y $vg1/$lv1
# lvconvert on dev512, ext4 1024, result 1024 (LV inactive when adding)
lvcreate --type raid1 -m1 -l 8 -n $lv1 $vg1
-aux wipefs_a /dev/$vg1/$lv1
+aux wipefs_a "$DM_DEV_DIR//$vg1/$lv1"
mkfs.ext4 -b 1024 "$DM_DEV_DIR/$vg1/$lv1"
blkid -p "$DM_DEV_DIR/$vg1/$lv1" | grep BLOCK_SIZE=\"1024\"
lvchange -an $vg1/$lv1
@@ -192,7 +192,7 @@ lvremove -y $vg1/$lv1
# lvconvert on dev4k, ext4 4096, result 4096
lvcreate --type raid1 -m1 -l 8 -n $lv1 $vg2
-aux wipefs_a /dev/$vg2/$lv1
+aux wipefs_a "$DM_DEV_DIR//$vg2/$lv1"
mkfs.ext4 "$DM_DEV_DIR/$vg2/$lv1"
blkid -p "$DM_DEV_DIR/$vg2/$lv1" | grep BLOCK_SIZE=\"4096\"
lvconvert --raidintegrity y $vg2/$lv1
@@ -204,7 +204,7 @@ lvremove -y $vg2/$lv1
# lvconvert --bs 512 on dev512, ext4 4096, result 512
lvcreate --type raid1 -m1 -l 8 -n $lv1 $vg1
-aux wipefs_a /dev/$vg1/$lv1
+aux wipefs_a "$DM_DEV_DIR//$vg1/$lv1"
mkfs.ext4 -b 4096 "$DM_DEV_DIR/$vg1/$lv1"
blkid -p "$DM_DEV_DIR/$vg1/$lv1" | grep BLOCK_SIZE=\"4096\"
lvconvert --raidintegrity y --raidintegrityblocksize 512 $vg1/$lv1
@@ -217,7 +217,7 @@ lvremove -y $vg1/$lv1
# lvconvert --bs 1024 on dev512, ext4 4096, result 1024
lvcreate --type raid1 -m1 -l 8 -n $lv1 $vg1
-aux wipefs_a /dev/$vg1/$lv1
+aux wipefs_a "$DM_DEV_DIR//$vg1/$lv1"
mkfs.ext4 -b 4096 "$DM_DEV_DIR/$vg1/$lv1"
blkid -p "$DM_DEV_DIR/$vg1/$lv1" | grep BLOCK_SIZE=\"4096\"
lvchange -an $vg1/$lv1
@@ -233,7 +233,7 @@ lvremove -y $vg1/$lv1
# lvconvert --bs 512 on dev512, ext4 1024, result 512
lvcreate --type raid1 -m1 -l 8 -n $lv1 $vg1
-aux wipefs_a /dev/$vg1/$lv1
+aux wipefs_a "$DM_DEV_DIR//$vg1/$lv1"
mkfs.ext4 -b 1024 "$DM_DEV_DIR/$vg1/$lv1"
blkid -p "$DM_DEV_DIR/$vg1/$lv1" | grep BLOCK_SIZE=\"1024\"
lvconvert --raidintegrity y --raidintegrityblocksize 512 $vg1/$lv1
@@ -245,7 +245,7 @@ lvremove -y $vg1/$lv1
# lvconvert --bs 512 on dev4k, ext4 4096, result fail
lvcreate --type raid1 -m1 -l 8 -n $lv1 $vg2
-aux wipefs_a /dev/$vg2/$lv1
+aux wipefs_a "$DM_DEV_DIR//$vg2/$lv1"
mkfs.ext4 "$DM_DEV_DIR/$vg2/$lv1"
not lvconvert --raidintegrity y --raidintegrityblocksize 512 $vg2/$lv1
lvremove -y $vg2/$lv1
@@ -257,7 +257,7 @@ lvremove -y $vg2/$lv1
# lvconvert on dev512, ext4 1024, result 1024, (detect fs with LV inactive)
lvcreate --type raid1 -m1 -l 8 -n $lv1 $vg1
-aux wipefs_a /dev/$vg1/$lv1
+aux wipefs_a "$DM_DEV_DIR//$vg1/$lv1"
mkfs.ext4 "$DM_DEV_DIR/$vg1/$lv1"
mount "$DM_DEV_DIR/$vg1/$lv1" $mnt
echo "test" > $mnt/test
@@ -277,7 +277,7 @@ lvremove -y $vg1/$lv1
# lvconvert on dev4k, ext4 4096, result 4096 (detect fs with LV inactive)
lvcreate --type raid1 -m1 -l 8 -n $lv1 $vg2
-aux wipefs_a /dev/$vg2/$lv1
+aux wipefs_a "$DM_DEV_DIR//$vg2/$lv1"
mkfs.ext4 "$DM_DEV_DIR/$vg2/$lv1"
mount "$DM_DEV_DIR/$vg2/$lv1" $mnt
echo "test" > $mnt/test
diff --git a/test/shell/lvconvert-raid-reshape-load.sh b/test/shell/lvconvert-raid-reshape-load.sh
index 29b8e4ca4..5b381ac09 100644
--- a/test/shell/lvconvert-raid-reshape-load.sh
+++ b/test/shell/lvconvert-raid-reshape-load.sh
@@ -45,8 +45,8 @@ lvcreate --yes --type raid5_ls --stripes 13 -L4 -n$lv1 $vg
check lv_first_seg_field $vg/$lv1 segtype "raid5_ls"
check lv_first_seg_field $vg/$lv1 data_stripes 13
check lv_first_seg_field $vg/$lv1 stripes 14
-wipefs -a /dev/$vg/$lv1
-mkfs -t ext4 /dev/$vg/$lv1
+wipefs -a "$DM_DEV_DIR/$vg/$lv1"
+mkfs -t ext4 "$DM_DEV_DIR/$vg/$lv1"
aux wait_for_sync $vg $lv1
mkdir -p $mount_dir
diff --git a/test/shell/lvconvert-raid-reshape-stripes-load-fail.sh b/test/shell/lvconvert-raid-reshape-stripes-load-fail.sh
index da9d34798..b35cd8db6 100644
--- a/test/shell/lvconvert-raid-reshape-stripes-load-fail.sh
+++ b/test/shell/lvconvert-raid-reshape-stripes-load-fail.sh
@@ -46,9 +46,9 @@ check lv_first_seg_field $vg/$lv1 segtype "raid5_ls"
check lv_first_seg_field $vg/$lv1 stripesize "64.00k"
check lv_first_seg_field $vg/$lv1 data_stripes 10
check lv_first_seg_field $vg/$lv1 stripes 11
-wipefs -a /dev/$vg/$lv1
-mkfs -t ext4 /dev/$vg/$lv1
-fsck -fn /dev/$vg/$lv1
+wipefs -a "$DM_DEV_DIR/$vg/$lv1"
+mkfs -t ext4 "$DM_DEV_DIR/$vg/$lv1"
+fsck -fn "$DM_DEV_DIR/$vg/$lv1"
mkdir -p "$mount_dir"
mount "$DM_DEV_DIR/$vg/$lv1" "$mount_dir"
diff --git a/test/shell/lvconvert-raid-reshape-stripes-load.sh b/test/shell/lvconvert-raid-reshape-stripes-load.sh
index 68ab8b92b..af1553418 100644
--- a/test/shell/lvconvert-raid-reshape-stripes-load.sh
+++ b/test/shell/lvconvert-raid-reshape-stripes-load.sh
@@ -46,8 +46,8 @@ check lv_first_seg_field $vg/$lv1 segtype "raid5_ls"
check lv_first_seg_field $vg/$lv1 stripesize "64.00k"
check lv_first_seg_field $vg/$lv1 data_stripes 10
check lv_first_seg_field $vg/$lv1 stripes 11
-wipefs -a /dev/$vg/$lv1
-mkfs -t ext4 /dev/$vg/$lv1
+wipefs -a "$DM_DEV_DIR/$vg/$lv1"
+mkfs -t ext4 "$DM_DEV_DIR//$vg/$lv1"
mkdir -p $mount_dir
mount "$DM_DEV_DIR/$vg/$lv1" $mount_dir
diff --git a/test/shell/vgchange-pvs-online.sh b/test/shell/vgchange-pvs-online.sh
index dab7f5ad7..165e96dde 100644
--- a/test/shell/vgchange-pvs-online.sh
+++ b/test/shell/vgchange-pvs-online.sh
@@ -30,10 +30,10 @@ DF="$DFDIR/system.devices"
# Because mapping devno to devname gets dm name from sysfs
aux lvmconf 'devices/scan = "/dev"'
-bd1="/dev/mapper/$(basename $dev1)"
-bd2="/dev/mapper/$(basename $dev2)"
-bd3="/dev/mapper/$(basename $dev3)"
-bd4="/dev/mapper/$(basename $dev4)"
+bd1="$DM_DEV_DIR/mapper/$(basename $dev1)"
+bd2="$DM_DEV_DIR/mapper/$(basename $dev2)"
+bd3="$DM_DEV_DIR/mapper/$(basename $dev3)"
+bd4="$DM_DEV_DIR/mapper/$(basename $dev4)"
aux extend_filter "a|$bd1|" "a|$bd2|" "a|$bd3|" "a|$bd4|"
# Changing names will confuse df based on devname
11 months
main - thin: add cfg support for thin_restore and cache_restore
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=fec3087eefc752036a4...
Commit: fec3087eefc752036a40d854c373132d25ffd30f
Parent: 8d09124c6204d49f6bda833229c96e8a76665127
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jun 23 14:39:44 2023 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 23 18:06:22 2023 +0200
thin: add cfg support for thin_restore and cache_restore
Add configurable paths for thin_restore and cache_restore.
---
lib/config/config_settings.h | 20 +++++++++++++++++++-
lib/config/defaults.h | 4 ++++
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h
index 2d6d957af..51e11857e 100644
--- a/lib/config/config_settings.h
+++ b/lib/config/config_settings.h
@@ -1177,7 +1177,7 @@ cfg(global_lvmlockctl_kill_command_CFG, "lvmlockctl_kill_command", global_CFG_SE
cfg(global_thin_check_executable_CFG, "thin_check_executable", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, THIN_CHECK_CMD, vsn(2, 2, 94), "@THIN_CHECK_CMD@", 0, NULL,
"The full path to the thin_check command.\n"
- "LVM uses this command to check that a thin metadata device is in a\n"
+ "LVM uses this command to check that a thin pool metadata device is in a\n"
"usable state. When a thin pool is activated and after it is\n"
"deactivated, this command is run. Activation will only proceed if\n"
"the command has an exit status of 0. Set to \"\" to skip this check.\n"
@@ -1195,6 +1195,12 @@ cfg(global_thin_repair_executable_CFG, "thin_repair_executable", global_CFG_SECT
"an unusable state. Also see thin_repair_options.\n"
"(See package device-mapper-persistent-data or thin-provisioning-tools)\n")
+cfg(global_thin_restore_executable_CFG, "thin_restore_executable", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, THIN_RESTORE_CMD, vsn(2, 3, 22), "@THIN_RESTORE_CMD@", 0, NULL,
+ "The full path to the thin_restore command.\n"
+ "LVM uses this command to restore generated data for a thin pool metadata device.\n"
+ "Also see thin_restore_options.\n"
+ "(See package device-mapper-persistent-data or thin-provisioning-tools)\n")
+
cfg_array(global_thin_check_options_CFG, "thin_check_options", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, DEFAULT_THIN_CHECK_OPTIONS_CONFIG, vsn(2, 2, 96), NULL, 0, NULL,
"List of options passed to the thin_check command.\n"
"With thin_check version 2.1 or newer you can add the option\n"
@@ -1205,6 +1211,9 @@ cfg_array(global_thin_check_options_CFG, "thin_check_options", global_CFG_SECTIO
cfg_array(global_thin_repair_options_CFG, "thin_repair_options", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, DEFAULT_THIN_REPAIR_OPTIONS_CONFIG, vsn(2, 2, 100), NULL, 0, NULL,
"List of options passed to the thin_repair command.\n")
+cfg_array(global_thin_restore_options_CFG, "thin_restore_options", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, DEFAULT_THIN_RESTORE_OPTIONS_CONFIG, vsn(2, 3, 22), NULL, 0, NULL,
+ "List of options passed to the thin_restore command.\n")
+
cfg_array(global_thin_disabled_features_CFG, "thin_disabled_features", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_UNDEFINED, CFG_TYPE_STRING, NULL, vsn(2, 2, 99), NULL, 0, NULL,
"Features to not use in the thin driver.\n"
"This can be helpful for testing, or to avoid using a feature that is\n"
@@ -1245,6 +1254,12 @@ cfg(global_cache_repair_executable_CFG, "cache_repair_executable", global_CFG_SE
"an unusable state. Also see cache_repair_options.\n"
"(See package device-mapper-persistent-data or thin-provisioning-tools)\n")
+cfg(global_cache_restore_executable_CFG, "cache_restore_executable", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, CACHE_RESTORE_CMD, vsn(2, 3, 22), "@CACHE_RESTORE_CMD@", 0, NULL,
+ "The full path to the cache_restore command.\n"
+ "LVM uses this command to restore generated data for a cache metadata device.\n"
+ "Also see cache_restore_options.\n"
+ "(See package device-mapper-persistent-data or thin-provisioning-tools)\n")
+
cfg_array(global_cache_check_options_CFG, "cache_check_options", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, DEFAULT_CACHE_CHECK_OPTIONS_CONFIG, vsn(2, 2, 108), NULL, 0, NULL,
"List of options passed to the cache_check command.\n"
"With cache_check version 5.0 or newer you should include the option\n"
@@ -1253,6 +1268,9 @@ cfg_array(global_cache_check_options_CFG, "cache_check_options", global_CFG_SECT
cfg_array(global_cache_repair_options_CFG, "cache_repair_options", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, DEFAULT_CACHE_REPAIR_OPTIONS_CONFIG, vsn(2, 2, 108), NULL, 0, NULL,
"List of options passed to the cache_repair command.\n")
+cfg_array(global_cache_restore_options_CFG, "cache_restore_options", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, DEFAULT_CACHE_RESTORE_OPTIONS_CONFIG, vsn(2, 3, 22), NULL, 0, NULL,
+ "List of options passed to the cache_restore command.\n")
+
cfg(global_vdo_format_executable_CFG, "vdo_format_executable", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, VDO_FORMAT_CMD, VDO_1ST_VSN, "@VDO_FORMAT_CMD@", 0, NULL,
"The full path to the vdoformat command.\n"
"LVM uses this command to initial data volume for VDO type logical volume\n")
diff --git a/lib/config/defaults.h b/lib/config/defaults.h
index 571054dc4..dd40ff3bf 100644
--- a/lib/config/defaults.h
+++ b/lib/config/defaults.h
@@ -117,6 +117,8 @@
#define DEFAULT_THIN_REPAIR_OPTION1 ""
#define DEFAULT_THIN_REPAIR_OPTIONS_CONFIG "#S" DEFAULT_THIN_REPAIR_OPTION1
+#define DEFAULT_THIN_RESTORE_OPTION1 ""
+#define DEFAULT_THIN_RESTORE_OPTIONS_CONFIG "#S" DEFAULT_THIN_RESTORE_OPTION1
#define DEFAULT_THIN_POOL_METADATA_REQUIRE_SEPARATE_PVS 0
#define DEFAULT_THIN_POOL_CROP_METADATA 0
#define DEFAULT_THIN_POOL_MAX_METADATA_SIZE_V1_KB (UINT64_C(255) * ((1 << 14) - 64) * 4) /* KB */ /* 0x3f8040 blocks */
@@ -145,6 +147,8 @@
#define DEFAULT_CACHE_REPAIR_OPTION1 ""
#define DEFAULT_CACHE_REPAIR_OPTIONS_CONFIG "#S" DEFAULT_CACHE_REPAIR_OPTION1
+#define DEFAULT_CACHE_RESTORE_OPTION1 ""
+#define DEFAULT_CACHE_RESTORE_OPTIONS_CONFIG "#S" DEFAULT_CACHE_RESTORE_OPTION1
#define DEFAULT_CACHE_POOL_METADATA_REQUIRE_SEPARATE_PVS 0
#define DEFAULT_CACHE_POOL_CHUNK_SIZE 64 /* KB */
#define DEFAULT_CACHE_POOL_MAX_CHUNKS 1000000
11 months
main - tests: update test for automatic virtual size correction
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=8d09124c6204d49f6bd...
Commit: 8d09124c6204d49f6bda833229c96e8a76665127
Parent: 657dde6208ddc8172b7d0e1466751046c8ddaeaa
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jun 23 18:03:25 2023 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 23 18:06:22 2023 +0200
tests: update test for automatic virtual size correction
lvm_import_vdo will adjust the virtual size within conversion
so the volume can be use without any futher tweaking.
---
test/shell/vdo-convert.sh | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/test/shell/vdo-convert.sh b/test/shell/vdo-convert.sh
index cb3dd7100..231939cf4 100644
--- a/test/shell/vdo-convert.sh
+++ b/test/shell/vdo-convert.sh
@@ -61,7 +61,6 @@ aux have_vdo 6 2 5 || skip
#
# In this case we do not need to move any VDO headers.
#
-if [ 1 -eq 0 ]; then
vgcreate $vg "$dev1"
lvcreate -L5G -n $lv1 $vg
@@ -139,7 +138,6 @@ lvm_import_vdo --vdo-config "$VDO_CONFIG" -y -v --name $vg1/$lv2 "$dev1"
fsck -n "$DM_DEV_DIR/$vg1/$lv2"
vgremove -f $vg1
-fi
aux wipefs_a "$dev1"
@@ -189,6 +187,8 @@ dmsetup table
# Get VDO table line
dmsetup table "$VDONAME" | tr " " "\n" | sed -e '5,6d' -e '12d' | tee vdo-orig
+mkfs.ext4 -E nodiscard "$DM_DEV_DIR/mapper/$VDONAME"
+
# For conversion we
aux lvmconf 'global/vdo_disabled_features = [ "version4" ]'
@@ -209,14 +209,22 @@ unset LVM_VDO_PREPARE
#lvm_import_vdo --no-snapshot --vdo-config "$VDO_CONFIG" -v -y --name $vg/$lv "$TEST"
lvm_import_vdo --vdo-config "$VDO_CONFIG" --uuid-prefix "$PREFIX" -v -y --name $vg/$lv "$TEST"
+dmsetup table
+
+# check our filesystem is OK
+fsck -n "$DM_DEV_DIR/$vg/$lv"
# Compare converted LV uses same VDO table line
dmsetup table "$vg-${lv}_vpool-vpool" | tr " " "\n" | sed -e '5,6d' -e '12d' | tee new-vdo-lv
+tail -n+3 vdo-orig >vdo-orig-3
+tail -n+3 new-vdo-lv >new-vdo-lv-3
+
# Check there is a match between VDO and LV managed volume
# (when differentiating parameters are deleted first)
-diff -u vdo-orig new-vdo-lv || die "Found mismatching VDO table lines!"
+# we need to skip first 2 lines as the device size gets rounded to match VG extent size
+diff -u vdo-orig-3 new-vdo-lv-3 || die "Found mismatching VDO table lines!"
-check lv_field $vg/$lv size "<23.00g"
+check lv_field $vg/$lv size "23.00g"
unset LVM_VDO_PREPARE
11 months
main - lvm_import_vdo: correct the converted virtual size
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=657dde6208ddc8172b7...
Commit: 657dde6208ddc8172b7d0e1466751046c8ddaeaa
Parent: ea6b5b694bf0886052b048b2e04b941ec65d90f9
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jun 23 18:01:32 2023 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 23 18:05:03 2023 +0200
lvm_import_vdo: correct the converted virtual size
Ensure the volume after conversion has the properly aligned size to the
volume group extent size. This would be visible when using virtual size,
that cannot be divided by extent size.
Before the user had to manually adjust the size after conversion to get
access to all data stored on VDO volume.
---
scripts/lvm_import_vdo.sh | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/scripts/lvm_import_vdo.sh b/scripts/lvm_import_vdo.sh
index bae4b52d1..13197c6fb 100755
--- a/scripts/lvm_import_vdo.sh
+++ b/scripts/lvm_import_vdo.sh
@@ -357,6 +357,7 @@ convert_lv_() {
# For best use the latest version of vdoprepareforlvm tool is required.
convert_non_lv_() {
local vdo_logicalSize=$1
+ local vdo_logicalSizeRounded
local extent_size
local output
local pvfree
@@ -417,7 +418,7 @@ convert_non_lv_() {
# Round virtual size to the LOWER size expressed in extent units.
# lvm is parsing VDO metadata and can read real full size and use it instead of this smaller value.
# To precisely byte-synchronize the size of VDO LV, user can lvresize such VDO LV later.
- vdo_logicalSize=$(( ( vdo_logicalSize / extent_size ) * extent_size ))
+ vdo_logicalSizeRounded=$(( ( vdo_logicalSize / extent_size ) * extent_size ))
verbose "Creating VG \"${NAME%/*}\" with extent size $extent_size KiB."
dry "$LVM" vgcreate $YES $VERB --devices "$devices" -s "${extent_size}k" "$VGNAME" "$devices" || {
@@ -428,7 +429,12 @@ convert_non_lv_() {
dry "$LVM" lvcreate -Zn -Wn -an $YES $VERB --devices "$devices" -l100%VG -n "${LVNAME}_vpool" "$VGNAME" "$devices"
verbose "Converting to VDO pool."
- dry "$LVM" lvconvert $YES $VERB $FORCE --devices "$devices" --config "$VDO_ALLOCATION_PARAMS" -Zn -V "${vdo_logicalSize}k" -n "$LVNAME" --type vdo-pool "$VGNAME/${LVNAME}_vpool"
+ dry "$LVM" lvconvert $YES $VERB $FORCE --devices "$devices" --config "$VDO_ALLOCATION_PARAMS" -Zn -V "${vdo_logicalSizeRounded}k" -n "$LVNAME" --type vdo-pool "$VGNAME/${LVNAME}_vpool"
+ if [ "$vdo_logicalSizeRounded" -lt "$vdo_logicalSize" ] ; then
+ # need to extend virtal size to be covering all the converted area
+ # let lvm2 to round to the proper virtual size of VDO LV
+ dry "$LVM" lvextend $YES $VERB --fs ignore --devices "$devices" -L "$vdo_logicalSize"k "$VGNAME/$LVNAME"
+ fi
dry "$LVM" vgchange -an $VERB $FORCE --devices "$devices" "$VGNAME"
11 months