[parted] - libparted: Flush parent device on open (#962611)

Brian C. Lane bcl at fedoraproject.org
Wed Sep 4 21:00:53 UTC 2013


commit 7e490f036c4f05e1ec270b02567c1f83cc673535
Author: Brian C. Lane <bcl at redhat.com>
Date:   Wed Sep 4 14:00:30 2013 -0700

    - libparted: Flush parent device on open (#962611)

 ...parted-Flush-parent-device-on-open-962611.patch |   35 ++++++++++++++++++++
 parted.spec                                        |    6 +++-
 2 files changed, 40 insertions(+), 1 deletions(-)
---
diff --git a/0070-libparted-Flush-parent-device-on-open-962611.patch b/0070-libparted-Flush-parent-device-on-open-962611.patch
new file mode 100644
index 0000000..416b7b4
--- /dev/null
+++ b/0070-libparted-Flush-parent-device-on-open-962611.patch
@@ -0,0 +1,35 @@
+From 115c74f3df2cb10e1f75d711175e8cbb301db594 Mon Sep 17 00:00:00 2001
+From: "Brian C. Lane" <bcl at redhat.com>
+Date: Wed, 4 Sep 2013 11:45:44 -0700
+Subject: [PATCH] libparted: Flush parent device on open (#962611)
+
+Parted probes for filesystems using geometry offsets into the parent
+device, not the partition device itself. This means it may get stale
+information if a partition has just been formatted.
+
+On kernels before 2.6 this will also flush all partition devices. On 2.6
+and newer kernels it will only flush the parent device.
+
+* libparted/arch/linux.c (linux_open): Always call _flush_cache
+---
+ libparted/arch/linux.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
+index 375be83..492f828 100644
+--- a/libparted/arch/linux.c
++++ b/libparted/arch/linux.c
+@@ -1669,9 +1669,7 @@ retry:
+                 dev->read_only = 0;
+         }
+ 
+-        /* With kernels < 2.6 flush cache for cache coherence issues */
+-        if (!_have_kern26())
+-                _flush_cache (dev);
++        _flush_cache (dev);
+ 
+         return 1;
+ }
+-- 
+1.8.3.1
+
diff --git a/parted.spec b/parted.spec
index 4269026..eb6f95a 100644
--- a/parted.spec
+++ b/parted.spec
@@ -4,7 +4,7 @@
 Summary: The GNU disk partition manipulation program
 Name:    parted
 Version: 3.1
-Release: 14%{?dist}
+Release: 15%{?dist}
 License: GPLv3+
 Group:   Applications/System
 URL:     http://www.gnu.org/software/parted
@@ -89,6 +89,7 @@ Patch0066: 0066-libparted-Add-UEFI-System-Partition-flag.patch
 Patch0067: 0067-libparted-Add-hfs_esp-partition-flag-to-GPT.patch
 Patch0068: 0068-libparted-Recognize-btrfs-filesystem.patch
 Patch0069: 0069-tests-Add-btrfs-and-xfs-to-the-fs-probe-test.patch
+Patch0070: 0070-libparted-Flush-parent-device-on-open-962611.patch
 
 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: e2fsprogs-devel
@@ -224,6 +225,9 @@ fi
 
 
 %changelog
+* Wed Sep 04 2013 Brian C. Lane <bcl at redhat.com> 3.1-15
+- libparted: Flush parent device on open (#962611)
+
 * Wed Aug 28 2013 Brian C. Lane <bcl at redhat.com> 3.1-14
 - Rebasing Fedora patches with upstream master since v3.1 release
 - Summary of important changes from upstream:


More information about the scm-commits mailing list