public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/python-blivet] rawhide: Drop the libparted device cache even if the device node is gone
@ 2026-10-01 10:51 Vojtech Trefny
0 siblings, 0 replies; only message in thread
From: Vojtech Trefny @ 2026-10-01 10:51 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/python-blivet
Branch : rawhide
Commit : d87eaeb277f2da4032daf9bab80ad522abf991a1
Author : Vojtech Trefny <vtrefny@redhat.com>
Date : 2026-10-01T12:34:17+02:00
Stats : +41/-1 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/python-blivet/c/d87eaeb277f2da4032daf9bab80ad522abf991a1?branch=rawhide
Log:
Drop the libparted device cache even if the device node is gone
---
diff --git a/0004-Drop-the-libparted-device-cache-even-if-the-device-node-is-gone.patch b/0004-Drop-the-libparted-device-cache-even-if-the-device-node-is-gone.patch
new file mode 100644
index 0000000..17b339c
--- /dev/null
+++ b/0004-Drop-the-libparted-device-cache-even-if-the-device-node-is-gone.patch
@@ -0,0 +1,36 @@
+From bf4da21cadddf50875768def03e634e9b2b86b44 Mon Sep 17 00:00:00 2001
+From: Adam Kankovsky <adamkankovsky@gmail.com>
+Date: Wed, 30 Sep 2026 19:34:34 +0200
+Subject: [PATCH] Drop the libparted device cache even if the device node is
+ gone
+
+libparted caches devices by their path. When a device is removed, blivet
+drops the cache in DeviceTree.reset(), but DiskLabel.drop_cache() skipped
+the libparted cache removal when the device node was already gone. The
+stale cached device then persisted and made the next read of a device
+that appeared at the same path (for example an MD RAID recreated with the
+same name) fail with an I/O error, which made blivet drop its partitions.
+
+Always drop the cached parted device, even when the device no longer
+exists.
+---
+ blivet/formats/disklabel.py | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/blivet/formats/disklabel.py b/blivet/formats/disklabel.py
+index bd16718fe..8f6b80c72 100644
+--- a/blivet/formats/disklabel.py
++++ b/blivet/formats/disklabel.py
+@@ -604,7 +604,11 @@ def magic_partition_number(self):
+ return 0
+
+ def drop_cache(self):
+- if self._parted_device and os.path.exists(self.device):
++ # libparted caches devices by their path, so the cache has to be
++ # dropped even when the device node is already gone (for example an
++ # MD RAID whose members were removed). Otherwise a device that later
++ # appears at the same path would reuse the stale cached data.
++ if self._parted_device:
+ ped_device = self._parted_device.getPedDevice()
+ if ped_device:
+ ped_device.cache_remove()
diff --git a/python-blivet.spec b/python-blivet.spec
index efd784d..747063a 100644
--- a/python-blivet.spec
+++ b/python-blivet.spec
@@ -5,7 +5,7 @@ Version: 3.14.2
#%%global prerelease .b2
# prerelease, if defined, should be something like .a1, .b1, .b2.dev1, or .c2
-Release: 2%{?prerelease}%{?dist}
+Release: 3%{?prerelease}%{?dist}
Epoch: 1
License: LGPL-2.1-or-later
%global realname blivet
@@ -19,6 +19,7 @@ Patch0: 0001-remove-btrfs-plugin.patch
Patch1: 0002-Flush-RAID-member-caches-after-creating-a-format.patch
Patch2: 0003-Fix-default-mount-options-for-NTFS.patch
+Patch3: 0004-Drop-the-libparted-device-cache-even-if-the-device-node-is-gone.patch
# Versions of required components (done so we make sure the buildrequires
# match the requires versions of things).
@@ -136,6 +137,9 @@ make DESTDIR=%{buildroot} install
%{python3_sitelib}/*
%changelog
+* Thu Oct 01 2026 Vojtech Trefny <vtrefny@redhat.com> - 1:3.14.2-3
+- Drop the libparted device cache even if the device node is gone
+
* Thu Sep 24 2026 Vojtech Trefny <vtrefny@redhat.com> - 1:3.14.2-2
- Fix default mount options for NTFS
- Flush RAID member caches after creating a format (#2530897)
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-01 10:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-01 10:51 [rpms/python-blivet] rawhide: Drop the libparted device cache even if the device node is gone Vojtech Trefny
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox