public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Vojtech Trefny <vtrefny@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/python-blivet] rawhide: Drop the libparted device cache even if the device node is gone
Date: Thu, 01 Oct 2026 10:51:49 GMT [thread overview]
Message-ID: <179085190951.1.10472577427160291076.rpms-python-blivet-d87eaeb277f2@fedoraproject.org> (raw)
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)
reply other threads:[~2026-10-01 10:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179085190951.1.10472577427160291076.rpms-python-blivet-d87eaeb277f2@fedoraproject.org \
--to=vtrefny@redhat.com \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox