Additional patches for 9.2.0 lvm2

Resolves: #2151601 # 2157591
This commit is contained in:
Marian Csontos 2022-12-22 12:28:53 +01:00
parent 10b58a92d2
commit efcd310f88
4 changed files with 80 additions and 1 deletions

View File

@ -0,0 +1,36 @@
From 20c6961e37bf6f5010f9d2035dbc1ce03f9b0223 Mon Sep 17 00:00:00 2001
From: David Teigland <teigland@redhat.com>
Date: Thu, 15 Dec 2022 09:57:04 -0600
Subject: [PATCH] lvextend: fix overprovisioning check for thin lvs
18722dfdf4d3 lvresize: restructure code
mistakenly changed the overprovisioning check from applying
to all lv_is_thin_type lvs to only lv_is_thin_pool lvs, so
it no longer applied when extending thin lvs. The result
was missing warning messages when extending thin lvs.
(cherry picked from commit 4baef0f93f608403b6f2db445e7bf1e80f8f3ee6)
---
lib/metadata/lv_manip.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 4cdbc19a0..f8eae0447 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -7007,9 +7007,10 @@ int lv_resize(struct cmd_context *cmd, struct logical_volume *lv,
if (lv_is_thin_pool(lv_top)) {
if (!update_thin_pool_lv(lv_top, 1))
goto_out;
- if (is_extend)
- thin_pool_check_overprovisioning(lv_top);
}
+ if (lv_is_thin_type(lv_top) && is_extend)
+ thin_pool_check_overprovisioning(lv_top);
+
if (lv_main && lv_is_cow_covering_origin(lv_main)) {
if (!monitor_dev_for_events(cmd, lv_main, 0, 0))
stack;
--
2.38.1

View File

@ -0,0 +1,32 @@
From db067b9054d87ada6aa133394e65e3af9d75fc08 Mon Sep 17 00:00:00 2001
From: David Teigland <teigland@redhat.com>
Date: Tue, 3 Jan 2023 11:38:33 -0600
Subject: [PATCH] lvresize: fix cryptsetup resize in helper
typo used "cryptresize" as command name
this affects cases where the file system is resized
independently, and then the lvresize command is used
which only needs to resize the crypt device and the LV.
(cherry picked from commit 81acde7ffdf9fbe522ada16f89e429d9f729dc0c)
---
scripts/lvresize_fs_helper.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/lvresize_fs_helper.sh b/scripts/lvresize_fs_helper.sh
index 031b8453b..f531dd447 100755
--- a/scripts/lvresize_fs_helper.sh
+++ b/scripts/lvresize_fs_helper.sh
@@ -224,7 +224,7 @@ fsreduce() {
cryptresize() {
NEWSIZESECTORS=$(($NEWSIZEBYTES/512))
logmsg "cryptsetup resize ${NEWSIZESECTORS} sectors ${DEVPATH}"
- cryptresize resize --size "$NEWSIZESECTORS" "$DEVPATH"
+ cryptsetup resize --size "$NEWSIZESECTORS" "$DEVPATH"
if [ $? -eq 0 ]; then
logmsg "cryptsetup done"
else
--
2.39.0

View File

@ -63,7 +63,7 @@ Version: 2.03.17
#Release: 0.1.20211115git%{shortcommit}%{?dist}%{?rel_suffix}
Release: 4%{?dist}%{?rel_suffix}
%else
Release: 3%{?dist}%{?rel_suffix}
Release: 4%{?dist}%{?rel_suffix}
%endif
License: GPLv2
URL: http://sourceware.org/lvm2
@ -74,6 +74,10 @@ Source0: ftp://sourceware.org/pub/lvm2/releases/LVM2.%{version}.tgz
%endif
# BZ 2150348:
Patch1: 0001-device_id-fix-segfault-verifying-serial-for-non-pv.patch
# BZ 2151601:
Patch2: 0002-lvextend-fix-overprovisioning-check-for-thin-lvs.patch
# BZ 2157591:
Patch3: 0003-lvresize-fix-cryptsetup-resize-in-helper.patch
BuildRequires: make
BuildRequires: gcc
@ -135,6 +139,8 @@ or more physical volumes and creating one or more logical volumes
%setup -q -n LVM2.%{version}
%endif
%patch1 -p1 -b .backup1
%patch2 -p1 -b .backup2
%patch3 -p1 -b .backup3
%build
%global _default_pid_dir /run
@ -706,6 +712,10 @@ An extensive functional testsuite for LVM2.
%endif
%changelog
* Fri Jan 06 2023 Marian Csontos <mcsontos@redhat.com> - 2.03.17-4
- Fix missing warning on thin pool over provisioning.
- Fix infinite recursion in lvresize_fs_helper when resizing LUKS device.
* Tue Dec 06 2022 Marian Csontos <mcsontos@redhat.com> - 2.03.17-3
- Fix segfault during scanning PVs.

View File

@ -54,6 +54,7 @@
- shell/lvconvert-raid-takeover.sh # did this ever work?
- shell/lvm-on-md.sh # check the test!
- shell/thin-flags.sh # check the test!
- shell/inconsistent-metadata.sh # In CI ends with "No space left on device"
# these may take considerable amount of time and consume lot of RAM - we are running these on our infrastructure:
# vgchange-many does not work in CI - it is timing out writing large amounts of data