stable-2.02 - man: update lvmthin
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=5e97bc5e6786b2187f5...
Commit: 5e97bc5e6786b2187f5326f35bcb82f47fd999a4
Parent: c56b3fa4e2042230054786697cd0781f44d56f93
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Jan 23 00:40:52 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Feb 1 13:43:13 2021 +0100
man: update lvmthin
Add few more notes about thin-pool repair.
Fix couple typos.
---
man/lvmthin.7_main | 37 +++++++++++++++++++++++++------------
1 file changed, 25 insertions(+), 12 deletions(-)
diff --git a/man/lvmthin.7_main b/man/lvmthin.7_main
index 5a2ccc440..39dcdfedc 100644
--- a/man/lvmthin.7_main
+++ b/man/lvmthin.7_main
@@ -394,7 +394,7 @@ the pmspare LV.
\&
If thin pool metadata is damaged, it may be repairable.
-Checking and repairing thin pool metadata is analagous to
+Checking and repairing thin pool metadata is analogous to
running fsck/repair on a file system.
When a thin pool LV is activated, lvm runs the thin_check command
@@ -437,14 +437,24 @@ copy to the VG's pmspare LV.
If step 1 is successful, the thin pool metadata LV is replaced
with the pmspare LV containing the corrected metadata.
The previous thin pool metadata LV, containing the damaged metadata,
-becomes visible with the new name ThinPoolLV_tmetaN (where N is 0,1,...).
-
-If the repair works, the thin pool LV and its thin LVs can be activated,
-and the LV containing the damaged thin pool metadata can be removed.
-It may be useful to move the new metadata LV (previously pmspare) to a
-better PV.
-
-If the repair does not work, the thin pool LV and its thin LVs are lost.
+becomes visible with the new name ThinPoolLV_metaN (where N is 0,1,...).
+
+If the repair works, the thin pool LV and its thin LVs can be activated.
+User should manually check if repaired thin pool kernel metadata
+has all data for all lvm2 known LVs by individual activation of
+every thin LV. When all works, user should continue with fsck of
+all filesystems present these such volumes.
+Once the thin pool is considered fully functional user may remove ThinPoolLV_metaN
+(the LV containing the damaged thin pool metadata) for possible
+space reuse.
+For a better performance it may be useful to pvmove the new repaired metadata LV
+(written to previous pmspare volume) to a better PV (i.e. SSD)
+
+If the repair operation fails, the thin pool LV and its thin LVs
+are not accessible and it may be necessary to restore their content
+from a backup. In such case the content of unmodified original damaged
+ThinPoolLV_metaN volume can be used by your support for more
+advanced recovery methods.
If metadata is manually restored with thin_repair directly,
the pool metadata LV can be manually swapped with another LV
@@ -452,6 +462,9 @@ containing new metadata:
.B lvconvert --thinpool VG/ThinPoolLV --poolmetadata VG/NewThinMetaLV
+Note: Thin pool metadata is compact so even small corruptions
+in them may result in significant portions of mappings to be lost.
+It is recommended to use fast resilient storage for them.
.SS Activation of thin snapshots
@@ -549,7 +562,7 @@ Command to extend thin pool data space:
.fi
Other methods of increasing free data space in a thin pool LV
-include removing a thin LV and its related snapsots, or running
+include removing a thin LV and its related snapshots, or running
fstrim on the file system using a thin LV.
@@ -689,7 +702,7 @@ with two configuration settings:
.B thin_pool_autoextend_threshold
.br
is a percentage full value that defines when the thin pool LV should be
-extended. Setting this to 100 disables automatic extention. The minimum
+extended. Setting this to 100 disables automatic extension. The minimum
value is 50.
.BR lvm.conf (5)
@@ -716,7 +729,7 @@ the --ignoremonitoring option can be used. With this option, the command
will not ask dmeventd to monitor the thin pool LV.
.IP \[bu]
-Setting thin_pool_autoextend_threshould to 100 disables automatic
+Setting thin_pool_autoextend_threshold to 100 disables automatic
extension of thin pool LVs, even if they are being monitored by dmeventd.
.P
2 years, 10 months
main - aux: update thin_restore_needs_more_volumes
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=25b942a8acd35c44ea3...
Commit: 25b942a8acd35c44ea39ff1840d8c4af0bed12d6
Parent: b26e565ee5d27314a58cba31e0a017d927698440
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jan 22 20:17:57 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Feb 1 12:13:49 2021 +0100
aux: update thin_restore_needs_more_volumes
Version 0.8.5-2.el7 needs to return 0;
---
test/lib/aux.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 5dbb580be..31741ac74 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -1471,6 +1471,7 @@ thin_restore_needs_more_volumes() {
case $("$LVM_TEST_THIN_RESTORE_CMD" -V) in
# With older version of thin-tool we got slightly more compact metadata
0.[0-6]*|0.7.0*) return 0 ;;
+ 0.8.5-2.el7) return 0 ;;
esac
return 1
}
2 years, 10 months
main - tests: check for cache support presence
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b26e565ee5d27314a58...
Commit: b26e565ee5d27314a58cba31e0a017d927698440
Parent: 19ddad12cae6b8c6a8011876302dd968ae3ddbeb
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jan 22 18:45:00 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Feb 1 12:13:49 2021 +0100
tests: check for cache support presence
---
test/shell/dev-aliases.sh | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/test/shell/dev-aliases.sh b/test/shell/dev-aliases.sh
index c97cd5da2..c3e4c7c53 100644
--- a/test/shell/dev-aliases.sh
+++ b/test/shell/dev-aliases.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
-# Copyright (C) 2012 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2021 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
@@ -14,9 +14,9 @@ SKIP_WITH_LVMPOLLD=1
. lib/inittest
-aux prepare_devs 3
+aux have_cache 1 10 0 || skip
-vgcreate $vg $dev1 $dev2 $dev3
+aux prepare_vg 3
#
# This lvconvert command will deactivate LV1, then internally create a new
@@ -37,13 +37,13 @@ vgcreate $vg $dev1 $dev2 $dev3
# wiping code would fail to open that stale name.
#
-lvcreate -n $lv1 -L32M $vg $dev1
-lvcreate -n $lv2 -L16M $vg $dev2
+lvcreate -n $lv1 -L32M $vg "$dev1"
+lvcreate -n $lv2 -L16M $vg "$dev2"
lvconvert -y --type cache-pool --poolmetadata $lv2 --cachemode writeback $vg/$lv1 --config='devices { preferred_names=["/dev/mapper/"] }'
lvremove -y $vg/$lv1
-lvcreate -n $lv1 -L32M $vg $dev1
-lvcreate -n $lv2 -L16M $vg $dev2
+lvcreate -n $lv1 -L32M $vg "$dev1"
+lvcreate -n $lv2 -L16M $vg "$dev2"
lvconvert -y --type cache-pool --poolmetadata $lv2 $vg/$lv1
lvremove -y $vg/$lv1
2 years, 10 months
main - tests: update thin and cache checked messages
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=19ddad12cae6b8c6a80...
Commit: 19ddad12cae6b8c6a8011876302dd968ae3ddbeb
Parent: b17b556e26e83bd9dadf711c5fba1d0d8939499f
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Jan 30 13:13:17 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Feb 1 12:13:49 2021 +0100
tests: update thin and cache checked messages
Slightly changed messages for allocation of pool metadata.
---
test/shell/lvconvert-thin.sh | 2 +-
test/shell/lvcreate-cache.sh | 12 +++++-------
test/shell/lvcreate-thin-big.sh | 10 +++++-----
3 files changed, 11 insertions(+), 13 deletions(-)
diff --git a/test/shell/lvconvert-thin.sh b/test/shell/lvconvert-thin.sh
index 131965508..ee8569164 100644
--- a/test/shell/lvconvert-thin.sh
+++ b/test/shell/lvconvert-thin.sh
@@ -128,7 +128,7 @@ lvcreate -L1T -n $lv1 $vg
lvcreate -L32G -n $lv2 $vg
# Warning about bigger then needed
lvconvert --yes --thinpool $vg/$lv1 --poolmetadata $vg/$lv2 2>&1 | tee err
-grep "WARNING: Maximum" err
+grep -i "maximum" err
lvremove -f $vg
diff --git a/test/shell/lvcreate-cache.sh b/test/shell/lvcreate-cache.sh
index 2c46e21c1..4d9d75eb9 100644
--- a/test/shell/lvcreate-cache.sh
+++ b/test/shell/lvcreate-cache.sh
@@ -27,7 +27,6 @@ aux prepare_vg 5 80000
aux lvmconf 'global/cache_disabled_features = [ "policy_smq" ]'
-
#######################
# Cache_Pool creation #
#######################
@@ -173,17 +172,16 @@ dmsetup table ${vg}-$lv1 | grep cache # ensure it is loaded in kernel
lvremove -f $vg
-
# Check minimum cache pool metadata size
-lvcreate -l 1 --type cache-pool --poolmetadatasize 1 $vg 2>out
-grep "WARNING: Minimum" out
+lvcreate -l 1 --type cache-pool --poolmetadatasize 1 $vg 2>&1 | tee out
+grep -i "minimal" out
+
# FIXME: This test is failing in allocator with smaller VG sizes
-lvcreate -l 1 --type cache-pool --poolmetadatasize 17G $vg 2>out
-grep "WARNING: Maximum" out
+lvcreate -l 1 --type cache-pool --poolmetadatasize 17G $vg 2>&1 | tee out
+grep -i "maximum" out
lvremove -f $vg
-
########################################
# Cache conversion and r/w permissions #
########################################
diff --git a/test/shell/lvcreate-thin-big.sh b/test/shell/lvcreate-thin-big.sh
index 0b622b7a9..254903548 100644
--- a/test/shell/lvcreate-thin-big.sh
+++ b/test/shell/lvcreate-thin-big.sh
@@ -31,14 +31,14 @@ vgcreate $SHARED -s 64K "$vg" "${DEVICES[@]}"
# Size 0 is not valid
invalid lvcreate -L4M --chunksize 128 --poolmetadatasize 0 -T $vg/pool1 2>out
-lvcreate -Zn -L4M --chunksize 128 --poolmetadatasize 16k -T $vg/pool1 2>out
-grep "WARNING: Minimum" out
+lvcreate -Zn -L4M --chunksize 128 --poolmetadatasize 16k -T $vg/pool1 2>&1 >out
+grep -i "minimal" out
# FIXME: metadata allocation fails, if PV doesn't have at least 16GB
# i.e. pool metadata device cannot be multisegment
-lvcreate -Zn -L4M --chunksize 64k --poolmetadatasize 17G -T $vg/pool2 2>out
-grep "WARNING: Maximum" out
+lvcreate -Zn -L4M --chunksize 64k --poolmetadatasize 17G -T $vg/pool2 2>&1 >out
+grep "maximum" out
check lv_field $vg/pool1_tmeta size "2.00m"
-check lv_field $vg/pool2_tmeta size "15.81g"
+check lv_field $vg/pool2_tmeta size "<15.88g"
# Check we do report correct percent values.
lvcreate --type zero -L3G $vg -n pool3
2 years, 10 months
main - tests: check 16G thin pool metadata size
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b17b556e26e83bd9dad...
Commit: b17b556e26e83bd9dadf711c5fba1d0d8939499f
Parent: 9fa4c099fb036883ee4abec200406824687372b8
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Jan 30 13:13:34 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Feb 1 12:13:49 2021 +0100
tests: check 16G thin pool metadata size
---
test/shell/thin-16g.sh | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 88 insertions(+)
diff --git a/test/shell/thin-16g.sh b/test/shell/thin-16g.sh
new file mode 100644
index 000000000..ee7e22ed2
--- /dev/null
+++ b/test/shell/thin-16g.sh
@@ -0,0 +1,88 @@
+#!/usr/bin/env bash
+
+# Copyright (C) 2021 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 usability of 16g thin pool metadata LV
+
+
+SKIP_WITH_LVMPOLLD=1
+
+. lib/inittest
+
+aux have_thin 1 0 0 || skip
+
+aux prepare_vg 1 50000
+
+lvcreate -T -L10 --poolmetadatasize 16g $vg/pool
+check lv_field $vg/pool_tmeta size "<15.88g"
+lvremove -f $vg
+
+# Cropped way
+lvcreate -T -L10 --poolmetadatasize 16g --config 'allocation/thin_pool_crop_metadata=1' $vg/pool
+check lv_field $vg/pool_tmeta size "15.81g"
+lvremove -f $vg
+
+lvcreate -L16G -n meta $vg
+lvcreate -L10 -n pool $vg
+lvconvert --yes --thinpool $vg/pool --poolmetadata meta
+# Uncropped size 33554432 sectors - 16GiB
+dmsetup table ${vg}-pool_tmeta | grep 33554432
+lvremove -f $vg
+
+# Uses 20G metadata volume, but crops the size in DM table
+lvcreate -L20G -n meta $vg
+lvcreate -L10 -n pool $vg
+lvconvert --yes --thinpool $vg/pool --poolmetadata meta --config 'allocation/thin_pool_crop_metadata=1'
+check lv_field $vg/lvol0_pmspare size "16.00g"
+# Size should be cropped to 33161216 sectors ~15.81GiB
+dmsetup table ${vg}-pool_tmeta | grep 33161216
+
+# Also size remains unchanged with activation has no cropping,
+# but metadata have no CROP_METADATA flag set
+lvchange -an $vg
+lvchange -ay $vg
+# Size still stays cropped to 33161216 sectors ~15.81GiB
+dmsetup table ${vg}-pool_tmeta | grep 33161216
+lvremove -f $vg
+
+# Minimal size is 2M
+lvcreate -L1M -n meta $vg
+lvcreate -L10 -n pool $vg
+not lvconvert --yes --thinpool $vg/pool --poolmetadata meta
+lvremove -f $vg
+
+# Uses 20G metadata volume, but crops the size in DM table
+lvcreate -L1 --poolmetadatasize 10G -T $vg/pool
+lvresize -L+10G $vg/pool_tmeta --config 'allocation/thin_pool_crop_metadata=1'
+check lv_field $vg/lvol0_pmspare size "15.81g"
+# Size should be cropped to 33161216 sectors ~15.81GiB
+dmsetup table ${vg}-pool_tmeta | grep 33161216
+
+# Without cropping we can grop to ~15.88GiB
+lvresize -L+10G $vg/pool_tmeta
+check lv_field $vg/lvol0_pmspare size "<15.88g"
+lvremove -f $vg
+
+# User has already 'bigger' metadata and wants them uncropped
+lvcreate -L16G -n meta $vg
+lvcreate -L10 -n pool $vg
+lvconvert --yes --thinpool $vg/pool --poolmetadata meta --config 'allocation/thin_pool_crop_metadata=1'
+
+# No change with cropping
+lvresize -l+1 $vg/pool_tmeta --config 'allocation/thin_pool_crop_metadata=1'
+dmsetup table ${vg}-pool_tmeta | grep 33161216
+
+# Resizes to 'uncropped' size 16GiB with ANY size
+lvresize -l+1 $vg/pool_tmeta
+dmsetup table ${vg}-pool_tmeta | grep 33554432
+check lv_field $vg/pool_tmeta size "16.00g"
+
+vgremove -ff $vg
2 years, 10 months
main - lvconvert: ensure device_name is defined
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=9fa4c099fb036883ee4...
Commit: 9fa4c099fb036883ee4abec200406824687372b8
Parent: a9fd207192fe81c1f89ca265c1fe0bcc54335694
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jan 22 21:45:05 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Feb 1 12:13:49 2021 +0100
lvconvert: ensure device_name is defined
---
tools/lvconvert.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 416e8a73a..e37172a5e 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -4283,7 +4283,7 @@ static int _lv_create_cachevol(struct cmd_context *cmd,
char format[NAME_LEN];
struct dm_list *use_pvh;
struct pv_list *pvl;
- char *device_name;
+ const char *device_name = "";
struct device *dev_fast;
char *dev_argv[MAX_CACHEDEVS];
int dev_argc = 0;
@@ -4317,7 +4317,7 @@ static int _lv_create_cachevol(struct cmd_context *cmd,
if (!grouped_arg_is_set(group->arg_values, cachedevice_ARG))
continue;
- if (!(device_name = (char *)grouped_arg_str_value(group->arg_values, cachedevice_ARG, NULL)))
+ if (!(device_name = grouped_arg_str_value(group->arg_values, cachedevice_ARG, NULL)))
break;
if (device_name[0] == '@') {
@@ -4366,7 +4366,7 @@ static int _lv_create_cachevol(struct cmd_context *cmd,
return 0;
}
- dev_argv[dev_argc++] = device_name;
+ dev_argv[dev_argc++] = (char*)device_name;
}
if (!cache_size_sectors)
2 years, 10 months
main - pvscan: enhance _count_pvid_files_from_lookup_file
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a9fd207192fe81c1f89...
Commit: a9fd207192fe81c1f89ca265c1fe0bcc54335694
Parent: 3acf6040b558a121d918a478859ae0c97a679047
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jan 22 22:27:05 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Feb 1 12:13:49 2021 +0100
pvscan: enhance _count_pvid_files_from_lookup_file
Ensure all vars are always properly defined in all paths.
---
tools/pvck.c | 2 +-
tools/pvscan.c | 56 +++++++++++++++++++++++++-------------------------------
2 files changed, 26 insertions(+), 32 deletions(-)
diff --git a/tools/pvck.c b/tools/pvck.c
index 88350de8c..c02ccb9f7 100644
--- a/tools/pvck.c
+++ b/tools/pvck.c
@@ -3015,7 +3015,7 @@ int pvck(struct cmd_context *cmd, int argc, char **argv)
struct device *dev = NULL;
struct devicefile *def = NULL;
const char *dump, *repair;
- const char *pv_name;
+ const char *pv_name = "";
uint64_t labelsector = 1;
int bad = 0;
int ret = 0;
diff --git a/tools/pvscan.c b/tools/pvscan.c
index 021ec691e..45d94c21b 100644
--- a/tools/pvscan.c
+++ b/tools/pvscan.c
@@ -517,14 +517,13 @@ static int _lookup_file_contains_pvid(FILE *fp, char *pvid)
static void _lookup_file_count_pvid_files(FILE *fp, const char *vgname, int *pvs_online, int *pvs_offline)
{
char line[64];
- char pvid[ID_LEN+1];
+ char pvid[ID_LEN+1] = { 0 };
log_debug("checking all pvid files using lookup file for %s", vgname);
rewind(fp);
while (fgets(line, sizeof(line), fp)) {
- memset(pvid, 0, sizeof(pvid));
memcpy(pvid, line, ID_LEN);
if (strlen(pvid) != ID_LEN) {
@@ -583,65 +582,60 @@ static int _count_pvid_files_from_lookup_file(struct cmd_context *cmd, struct de
int *pvs_online, int *pvs_offline,
const char **vgname_out)
{
- char path[PATH_MAX];
+ char path[PATH_MAX] = { 0 };
FILE *fp;
DIR *dir;
struct dirent *de;
const char *vgname = NULL;
- int online = 0, offline = 0;
+ *vgname_out = NULL;
*pvs_online = 0;
*pvs_offline = 0;
- if (!(dir = opendir(_pvs_lookup_dir)))
- goto_bad;
+ if (!(dir = opendir(_pvs_lookup_dir))) {
+ log_sys_debug("opendir", _pvs_lookup_dir);
+ return 0;
+ }
/*
* Read each file in pvs_lookup to find dev->pvid, and if it's
* found save the vgname of the file it's found in.
*/
- while ((de = readdir(dir))) {
+ while (!vgname && (de = readdir(dir))) {
if (de->d_name[0] == '.')
continue;
- memset(path, 0, sizeof(path));
- snprintf(path, sizeof(path), "%s/%s", _pvs_lookup_dir, de->d_name);
+ if (dm_snprintf(path, sizeof(path), "%s/%s", _pvs_lookup_dir, de->d_name) < 0) {
+ log_warn("WARNING: Path %s/%s is too long.", _pvs_lookup_dir, de->d_name);
+ continue;
+ }
if (!(fp = fopen(path, "r"))) {
- log_warn("Failed to open %s", path);
+ log_warn("WARNING: Failed to open %s.", path);
continue;
}
if (_lookup_file_contains_pvid(fp, dev->pvid)) {
- vgname = dm_pool_strdup(cmd->mem, de->d_name);
- break;
+ if ((vgname = dm_pool_strdup(cmd->mem, de->d_name)))
+ /*
+ * stat pvid online file of each pvid listed in this file
+ * the list of pvids from the file is the alternative to
+ * using vg->pvs
+ */
+ _lookup_file_count_pvid_files(fp, vgname, pvs_online, pvs_offline);
+ else
+ log_warn("WARNING: Failed to strdup vgname.");
}
if (fclose(fp))
- stack;
+ log_sys_debug("fclose", path);
}
if (closedir(dir))
log_sys_debug("closedir", _pvs_lookup_dir);
- if (!vgname)
- goto_bad;
-
- /*
- * stat pvid online file of each pvid listed in this file
- * the list of pvids from the file is the alternative to
- * using vg->pvs
- */
- _lookup_file_count_pvid_files(fp, vgname, &online, &offline);
-
- if (fclose(fp))
- stack;
-
- *pvs_online = online;
- *pvs_offline = offline;
*vgname_out = vgname;
- return 1;
-bad:
- return 0;
+
+ return (vgname) ? 1 : 0;
}
static void _online_dir_setup(void)
2 years, 10 months
main - wipe: reformat message for failure case
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=3acf6040b558a121d91...
Commit: 3acf6040b558a121d918a478859ae0c97a679047
Parent: 8f5695fa71e0b293e774cfbaf7af7985896cd47a
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jan 22 19:21:55 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Feb 1 12:13:49 2021 +0100
wipe: reformat message for failure case
Use the same error message layout to match BLKZEROUT look.
Makes testing easier.
---
lib/metadata/lv_manip.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index c82038269..d101fa582 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -7785,10 +7785,10 @@ retry_with_dev_set:
#endif
if (!dev_set_bytes(dev, UINT64_C(0), (size_t) zero_sectors << SECTOR_SHIFT, wp.zero_value)) {
sigint_restore();
- log_error("%s %s of logical volume %s with value %d.",
+ log_error("%s logical volume %s with value %d and size %s.",
sigint_caught() ? "Interrupted initialization" : "Failed to initialize",
- display_size(lv->vg->cmd, zero_sectors),
- display_lvname(lv), wp.zero_value);
+ display_lvname(lv), wp.zero_value,
+ display_size(lv->vg->cmd, zero_sectors));
return 0;
}
}
2 years, 10 months
main - WHATS_NEW: updates
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=8f5695fa71e0b293e77...
Commit: 8f5695fa71e0b293e774cfbaf7af7985896cd47a
Parent: be0bf43d742a127435962d7075608519f18d4cdc
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Feb 1 12:12:23 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Feb 1 12:13:49 2021 +0100
WHATS_NEW: updates
---
WHATS_NEW | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/WHATS_NEW b/WHATS_NEW
index ef1afaabd..c6be9b481 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,10 @@
Version 2.03.12 -
===================================
+ Allocation prints better error when metadata cannot fit on a single PV.
+ Pvmove can better resolve full thin-pool tree move.
+ Limit pool metadata spare to 16GiB.
+ Improves convertsion and allocation of pool metadata.
+ Support thin pool metadata 15.88GiB, adds 64MiB, thin_pool_crop_metadata=0.
Enhance lvdisplay to report raid availiable/partial.
Support online rename of VDO pools.
Imporove removal of pmspare when last pool is removed.
2 years, 10 months
main - allocation: report allocation error instead of crash
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=be0bf43d742a1274359...
Commit: be0bf43d742a127435962d7075608519f18d4cdc
Parent: 45f0c48365457b2ca4cec163f4435327f0978bd3
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Feb 1 10:24:19 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Feb 1 12:13:49 2021 +0100
allocation: report allocation error instead of crash
Current allocation limitation requires to fit metadata/log LV on
a single PV. This is usually not a big problem, but since
thin-pool and cache-pool is using this for allocating extents
for their metadata LVs it might be eventually causing errors
where the remaining free spaces for large metadata size is spread
over several PV.
---
lib/metadata/lv_manip.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 093cea464..c82038269 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -2109,15 +2109,18 @@ static int _alloc_parallel_area(struct alloc_handle *ah, uint32_t max_to_allocat
aa[smeta].pv = pva->map->pv;
aa[smeta].pe = pva->start;
aa[smeta].len = ah->log_len;
-
+ if (aa[smeta].len > pva->count) {
+ log_error("Metadata does not fit on a single PV.");
+ return 0;
+ }
log_debug_alloc("Allocating parallel metadata area %" PRIu32
" on %s start PE %" PRIu32
" length %" PRIu32 ".",
(smeta - (ah->area_count + ah->parity_count)),
pv_dev_name(aa[smeta].pv), aa[smeta].pe,
- ah->log_len);
+ aa[smeta].len);
- consume_pv_area(pva, ah->log_len);
+ consume_pv_area(pva, aa[smeta].len);
dm_list_add(&ah->alloced_areas[smeta], &aa[smeta].list);
}
aa[s].len = (ah->alloc_and_split_meta && !ah->split_metadata_is_allocated) ? len - ah->log_len : len;
2 years, 10 months