Tell LVM DBus to refresh it's internal status during reset
Resolves: RHEL-93967
This commit is contained in:
parent
49c7fb9de1
commit
23e5f996e1
@ -0,0 +1,65 @@
|
|||||||
|
From ee19e665276fd7cd6477da9bee59641b1de1a916 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||||
|
Date: Fri, 27 Jun 2025 11:28:09 +0200
|
||||||
|
Subject: [PATCH] Tell LVM DBus to refresh it's internal status during reset
|
||||||
|
|
||||||
|
Unfortunately some users run wipefs <disk> thinking it's enough
|
||||||
|
to remove all devices on top of the disk cleanly.
|
||||||
|
In cases where the PV is not directly on the disk, LVM DBus
|
||||||
|
doesn't get a udev event and doesn't remove the VG and LVs from
|
||||||
|
DBus so we think these still exist.
|
||||||
|
|
||||||
|
Resolves: RHEL-93967
|
||||||
|
---
|
||||||
|
blivet/devicelibs/lvm.py | 19 +++++++++++++++++++
|
||||||
|
blivet/populator/populator.py | 3 +++
|
||||||
|
2 files changed, 22 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/blivet/devicelibs/lvm.py b/blivet/devicelibs/lvm.py
|
||||||
|
index 38e1bc1bc..47cc3e5d7 100644
|
||||||
|
--- a/blivet/devicelibs/lvm.py
|
||||||
|
+++ b/blivet/devicelibs/lvm.py
|
||||||
|
@@ -36,6 +36,7 @@
|
||||||
|
log = logging.getLogger("blivet")
|
||||||
|
|
||||||
|
from . import raid
|
||||||
|
+from .. import safe_dbus
|
||||||
|
from ..size import Size
|
||||||
|
from ..i18n import N_
|
||||||
|
from ..flags import flags
|
||||||
|
@@ -284,3 +285,21 @@ def recommend_thpool_chunk_size(thpool_size):
|
||||||
|
|
||||||
|
def is_valid_cache_md_size(md_size):
|
||||||
|
return md_size >= LVM_CACHE_MIN_METADATA_SIZE and md_size <= LVM_CACHE_MAX_METADATA_SIZE
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+def lvm_dbusd_refresh():
|
||||||
|
+ lvm_soname = blockdev.get_plugin_soname(blockdev.Plugin.LVM)
|
||||||
|
+ if 'dbus' not in lvm_soname:
|
||||||
|
+ return
|
||||||
|
+
|
||||||
|
+ try:
|
||||||
|
+ rc = safe_dbus.call_sync("com.redhat.lvmdbus1",
|
||||||
|
+ "/com/redhat/lvmdbus1/Manager",
|
||||||
|
+ "com.redhat.lvmdbus1.Manager",
|
||||||
|
+ "Refresh",
|
||||||
|
+ None)
|
||||||
|
+ except safe_dbus.DBusCallError as e:
|
||||||
|
+ log.error("Exception occurred when calling LVM DBusD refresh: %s", str(e))
|
||||||
|
+ else:
|
||||||
|
+ if rc[0] != 0:
|
||||||
|
+ log.error("Failed to call LVM DBusD refresh: %s", rc)
|
||||||
|
diff --git a/blivet/populator/populator.py b/blivet/populator/populator.py
|
||||||
|
index 2ddea6618..da3b33cac 100644
|
||||||
|
--- a/blivet/populator/populator.py
|
||||||
|
+++ b/blivet/populator/populator.py
|
||||||
|
@@ -453,6 +453,9 @@ def _populate(self):
|
||||||
|
disklib.update_volume_info()
|
||||||
|
self.drop_device_info_cache()
|
||||||
|
|
||||||
|
+ # force LVM DBusD to refresh its internal state
|
||||||
|
+ lvm.lvm_dbusd_refresh()
|
||||||
|
+
|
||||||
|
if flags.auto_dev_updates and availability.BLOCKDEV_MPATH_PLUGIN.available:
|
||||||
|
blockdev.mpath.set_friendly_names(flags.multipath_friendly_names)
|
||||||
|
|
@ -5,7 +5,7 @@ Version: 3.10.0
|
|||||||
|
|
||||||
#%%global prerelease .b2
|
#%%global prerelease .b2
|
||||||
# prerelease, if defined, should be something like .a1, .b1, .b2.dev1, or .c2
|
# prerelease, if defined, should be something like .a1, .b1, .b2.dev1, or .c2
|
||||||
Release: 20%{?prerelease}%{?dist}
|
Release: 21%{?prerelease}%{?dist}
|
||||||
Epoch: 1
|
Epoch: 1
|
||||||
License: LGPL-2.1-or-later
|
License: LGPL-2.1-or-later
|
||||||
%global realname blivet
|
%global realname blivet
|
||||||
@ -35,6 +35,7 @@ Patch15: 0017-LVMPV-format-size-fix.patch
|
|||||||
Patch16: 0018-Include-additional-information-in-PartitioningError.patch
|
Patch16: 0018-Include-additional-information-in-PartitioningError.patch
|
||||||
Patch17: 0019-Make-ActionDestroyFormat-optional.patch
|
Patch17: 0019-Make-ActionDestroyFormat-optional.patch
|
||||||
Patch18: 0020-Wipe-end-partition-before-creating-it-as-well-as-the-start.patch
|
Patch18: 0020-Wipe-end-partition-before-creating-it-as-well-as-the-start.patch
|
||||||
|
Patch19: 0021-Tell-LVM-DBus-to-refresh-its-internal-status-during-reset.patch
|
||||||
|
|
||||||
# Versions of required components (done so we make sure the buildrequires
|
# Versions of required components (done so we make sure the buildrequires
|
||||||
# match the requires versions of things).
|
# match the requires versions of things).
|
||||||
@ -129,6 +130,10 @@ make DESTDIR=%{buildroot} install
|
|||||||
%{python3_sitelib}/*
|
%{python3_sitelib}/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Jul 01 2025 Vojtech Trefny <vtrefny@redhat.com> - 3.10.0-21
|
||||||
|
- Tell LVM DBus to refresh it's internal status during reset
|
||||||
|
Resolves: RHEL-93967
|
||||||
|
|
||||||
* Fri May 30 2025 Vojtech Trefny <vtrefny@redhat.com> - 3.10.0-20
|
* Fri May 30 2025 Vojtech Trefny <vtrefny@redhat.com> - 3.10.0-20
|
||||||
- Wipe end partition before creating it as well as the start
|
- Wipe end partition before creating it as well as the start
|
||||||
Resolves: RHEL-93967
|
Resolves: RHEL-93967
|
||||||
|
Loading…
Reference in New Issue
Block a user