[parted/f17] - libparted: avoid unwarranted failed assertion (#800235)
Brian C. Lane
bcl at fedoraproject.org
Wed Mar 14 19:07:16 UTC 2012
commit d0cd8da5bb665bece6b23d7b2eb403c94eeb16d9
Author: Brian C. Lane <bcl at redhat.com>
Date: Wed Mar 14 11:43:51 2012 -0700
- libparted: avoid unwarranted failed assertion (#800235)
...void-unwarranted-failed-assertion-during-.patch | 59 ++++++++++++++++++++
parted.spec | 6 ++-
2 files changed, 64 insertions(+), 1 deletions(-)
---
diff --git a/parted-3.1-libparted-avoid-unwarranted-failed-assertion-during-.patch b/parted-3.1-libparted-avoid-unwarranted-failed-assertion-during-.patch
new file mode 100644
index 0000000..c47a0d6
--- /dev/null
+++ b/parted-3.1-libparted-avoid-unwarranted-failed-assertion-during-.patch
@@ -0,0 +1,59 @@
+From 717affeb4dd8fb40d0b08e71a8a7cbaaabbf7e7e Mon Sep 17 00:00:00 2001
+From: Jim Meyering <meyering at redhat.com>
+Date: Sun, 26 Feb 2012 18:04:37 +0100
+Subject: [PATCH] libparted: avoid unwarranted failed assertion during mklabel
+
+This could happen when running "parted -s $dev mklabel $type" for
+nearly any $type, assuming the underlying disk's sector size is
+larger than 512 bytes. This particular failure was noticed by
+running tests/t9050-partition-table-types.sh with a simulated
+sector size of 1024, as is done as part of a top-level "make check",
+but so far, this failure has shown up only on RHEL-6.2.
+That test attempts to exercise an ugly part of partition table
+creation: during creation, parted checks for an existing
+partition table by iterating through its list of known types and
+attempting to read the disk, looking for a preexisting table.
+Knowing this, the test takes all pairs of partition table types,
+<A,B> and first creates a type of type A, and then creates on top
+of that (erasing the original) a table of type B.
+* libparted/labels/mac.c (_disk_analyse_ghost_size): Remove bogus
+assertion. If the number of the sector with a matching signature
+is too large, simply reject it by returning 0.
+* NEWS (Bug fixes): Mention this.
+---
+ NEWS | 5 +++++
+ libparted/labels/mac.c | 3 +--
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index d535612..2c1032d 100644
+--- a/NEWS
++++ b/NEWS
+@@ -1,5 +1,10 @@
+ GNU parted NEWS -*- outline -*-
+
++* Noteworthy changes in release 3.0-8 (Fedora)
++
++ libparted: creating a new partition table on a device with an existing
++ mac partition table could result in a failed assertion.
++
+ * Noteworthy changes in release 3.0-6 (Fedora)
+
+ Add the ability to set the boot flag on the GPT PMBR. This is needed
+diff --git a/libparted/labels/mac.c b/libparted/labels/mac.c
+index bd756c2..3f04a51 100644
+--- a/libparted/labels/mac.c
++++ b/libparted/labels/mac.c
+@@ -704,8 +704,7 @@ _disk_analyse_ghost_size (PedDisk* disk)
+ if (_rawpart_check_signature (buf)
+ && !_rawpart_is_void (buf)) {
+ mac_disk_data->ghost_size = i;
+- PED_ASSERT (i <= disk->dev->sector_size / 512);
+- found = 1;
++ found = (i <= disk->dev->sector_size / 512);
+ break;
+ }
+ }
+--
+1.7.7.6
+
diff --git a/parted.spec b/parted.spec
index a13c001..b4cd04e 100644
--- a/parted.spec
+++ b/parted.spec
@@ -4,7 +4,7 @@
Summary: The GNU disk partition manipulation program
Name: parted
Version: 3.0
-Release: 7%{?dist}
+Release: 8%{?dist}
License: GPLv3+
Group: Applications/System
URL: http://www.gnu.org/software/parted
@@ -38,6 +38,7 @@ Patch17: parted-3.0-tests-update-tests-for-new-disk-flags-output.patch
Patch18: parted-3.0-tests-add-test-for-GPT-PMBR-pmbr_boot-flag.patch
Patch19: parted-3.0-doc-update-parted-documentation.patch
Patch20: parted-3.0-libparted-copy-pmbr_boot-when-duplicating-GPT-disk.patch
+Patch21: parted-3.1-libparted-avoid-unwarranted-failed-assertion-during-.patch
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: e2fsprogs-devel
@@ -168,6 +169,9 @@ fi
%changelog
+* Wed Mar 14 2012 Brian C. Lane <bcl at redhat.com> 3.0-8
+- libparted: avoid unwarranted failed assertion (#800235)
+
* Fri Feb 03 2012 Brian C. Lane <bcl at redhat.com> - 3.0-7
- Update patch for copying flags so that it is generic
- Copy pmbr_boot flag in gpt_duplicate
More information about the scm-commits
mailing list