import UBI lvm2-2.03.32-2.el9_7.1

This commit is contained in:
eabdullin 2025-12-18 12:43:45 +00:00
parent 4fb2f797fb
commit e33975f5ab
5 changed files with 183 additions and 1 deletions

View File

@ -0,0 +1,48 @@
From 1742273a30f6ed5fa0176805f8bd1c133b2a600c Mon Sep 17 00:00:00 2001
From: David Teigland <teigland@redhat.com>
Date: Mon, 27 Oct 2025 11:01:16 -0500
Subject: [PATCH 15/18] activating raid LV with partial snapshot is an error
Detect and report this error early in the command, with
a clear message, including a possible remedy. Previously,
the command failed at a lower level, where the message is
confusing or even misleading.
Old error message:
"Aborting. LV vg/snap1 is incomplete and --activationmode partial was not specified."
New error message:
"Activating raid LV vg/main requires the removal of partial snapshot vg/snap1."
(cherry picked from commit 2760e804630a36bab2c3938ce9ac0b08c5e75395)
---
tools/toollib.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/tools/toollib.c b/tools/toollib.c
index 9235f431f..0e711fbc7 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -781,6 +781,19 @@ int lv_change_activate(struct cmd_context *cmd, struct logical_volume *lv,
}
}
+ if (lv_is_raid(lv) && lv_is_origin(lv) && lv_is_partial(lv)) {
+ struct lv_list *lvl;
+ dm_list_iterate_items(lvl, &lv->vg->lvs) {
+ if (lv_is_cow(lvl->lv) &&
+ (lv_origin_lv(lvl->lv) == lv) &&
+ lv_is_partial(lvl->lv)) {
+ log_error("Activating raid LV %s requires the removal of partial snapshot %s.",
+ display_lvname(lv), display_lvname(lvl->lv));
+ return 0;
+ }
+ }
+ }
+
if (is_change_activating(activate) &&
lvmcache_has_duplicate_devs() &&
vg_has_duplicate_pvs(lv->vg) &&
--
2.51.1

View File

@ -0,0 +1,34 @@
From 2e8e66c62f67405223c6c208f343f0540505aa36 Mon Sep 17 00:00:00 2001
From: Heinz Mauelshagen <heinzm@redhat.com>
Date: Mon, 27 Oct 2025 17:37:09 +0100
Subject: [PATCH 16/18] lv_manip: show a warning during classic snapshot
creation on a RaidLV.
The RaidLV will fail to activate in case of the loss of any of its snapshots.
Once created, commit 2760e804630a36bab2c3938ce9ac0b08c5e75395 will
catch any loss of such snapshots and provide remedy information.
(cherry picked from commit ae81b41811ede78b77f6badf0c65c88fa56cc951)
---
lib/metadata/lv_manip.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index b188ea280..2de982b24 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -9628,6 +9628,11 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
goto revert_new_lv;
}
+ if (lp->snapshot && origin_lv && lv_is_raid(origin_lv)) {
+ log_warn("WARNING: Loss of snapshot %s will cause the activation of the %s LV %s to fail!",
+ lp->lv_name, lvseg_name(first_seg(origin_lv)), display_lvname(origin_lv));
+ }
+
/* Do not scan this LV until properly zeroed/wiped. */
if (_should_wipe_lv(lp, lv, 0))
lv->status |= LV_NOSCAN;
--
2.51.1

View File

@ -0,0 +1,67 @@
From c2b5a0f3b8825ce0ac04e405633fb435d3471d20 Mon Sep 17 00:00:00 2001
From: Heinz Mauelshagen <heinzm@redhat.com>
Date: Mon, 27 Oct 2025 19:12:25 +0100
Subject: [PATCH 17/18] test: add new test for snapshot on raid
creation/activation warning/error
(cherry picked from commit 6704ef4012e8c187deaeadb1275e2d80661c3941)
---
...shot-create-warning-activate-error-raid.sh | 46 +++++++++++++++++++
1 file changed, 46 insertions(+)
create mode 100644 test/shell/snapshot-create-warning-activate-error-raid.sh
diff --git a/test/shell/snapshot-create-warning-activate-error-raid.sh b/test/shell/snapshot-create-warning-activate-error-raid.sh
new file mode 100644
index 000000000..c5b65d018
--- /dev/null
+++ b/test/shell/snapshot-create-warning-activate-error-raid.sh
@@ -0,0 +1,46 @@
+#!/usr/bin/env bash
+
+# Copyright (C) 2025 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 for classic snapshots of raid throwing warning/error on creation/activation
+
+
+. lib/inittest --skip-with-lvmpolld
+
+aux have_raid 1 3 0 || skip
+
+aux prepare_devs 2 50
+
+# Create Raid1LV and wait for initial sync to finish.
+vgcreate $SHARED $vg "$dev1" "$dev2"
+lvcreate -y --type raid1 -m1 -n $lv1 -L32M $vg
+aux wait_for_sync $vg $lv1
+
+# Create classic snapshot of Raid1LV and check for warning message.
+lvcreate -y -s -n snap -L12M $vg/$lv1 "$dev1" 2>&1 | grep 'WARNING: Loss of snapshot ' >/dev/null 2>&1
+
+# Disable all LVs and the first PV with the snapshot allocated on.
+vgchange -an $vg
+aux disable_dev "$dev1"
+
+# Active vg and check for warning message.
+not vgchange -ay $vg 2>&1 | grep -E 'Activating raid LV .* requires the removal of partial snapshot' >/dev/null 2>&1
+
+# Remove the snapshot having lost its backing PV.
+lvremove -y $vg/snap
+
+# Active vg and check for warning message not being displayed.
+vgchange -ay $vg 2>&1 | not grep -E 'Activating raid LV .* requires the removal of partial snapshot' >/dev/null 2>&1
+
+ls $DM_DEV_DIR/$vg/$lv1
+
+lvremove -y $vg/$lv1
+vgremove -ff $vg
--
2.51.1

View File

@ -0,0 +1,25 @@
From 34c6bcf41bd06fa8264e71026ce0008bdb0d0cea Mon Sep 17 00:00:00 2001
From: Heinz Mauelshagen <heinzm@redhat.com>
Date: Mon, 27 Oct 2025 19:15:06 +0100
Subject: [PATCH 18/18] WHATS_NEW: update
(cherry picked from commit b8f7635e1692fcfc5ea34e1dcaea2ebb6df94431)
---
WHATS_NEW | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/WHATS_NEW b/WHATS_NEW
index c9af7be6e..4afebb594 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,3 +1,7 @@
+Version 2.03.37 -
+==================
+ Warn on classic snapshot on raid creation and error on activation + test.
+
Version 2.03.33 -
==================
Repair raid arrays with transiently lost devices.
--
2.51.1

View File

@ -41,7 +41,7 @@
%global commit 4a1f6173d29a7d7ecab14a9313000aa5f81170d0
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%endif
#%%global rel_suffix .bz2141837
%global rel_suffix .1
# Do not reset Release to 1 unless both lvm2 and device-mapper
# versions are increased together.
@ -79,6 +79,11 @@ Patch11: 0011-lvconvert-allow-clearing-superblocks.patch
Patch12: 0012-test-check-raid-superblock-clearing.patch
Patch13: 0013-man-update-raid-man.patch
Patch14: 0014-WHATS_NEW-update.patch
# RHEL-124926:
Patch15: 0015-activating-raid-LV-with-partial-snapshot-is-an-error.patch
Patch16: 0016-lv_manip-show-a-warning-during-classic-snapshot-crea.patch
Patch17: 0017-test-add-new-test-for-snapshot-on-raid-creation-acti.patch
Patch18: 0018-WHATS_NEW-update.patch
BuildRequires: make
BuildRequires: gcc
@ -710,6 +715,9 @@ An extensive functional testsuite for LVM2.
%endif
%changelog
* Mon Nov 10 2025 Marian Csontos <mcsontos@redhat.com> - 2.03.32-2.el9_7.1
- Add message when activating RAID volumes with snapshots.
* Tue Jun 03 2025 Marian Csontos <mcsontos@redhat.com> - 2.03.32-2
- Fix vgremove hanging immediately after lockstart.
- Add repair option for RAID volumes with too many transiently failed devices.