Blame SOURCES/0024-libparted-make-sure-not-to-treat-percentages-as-exac.patch

fc4a62
From 911bc52b2609ccb2cc3b123ce383b07c66d54048 Mon Sep 17 00:00:00 2001
fc4a62
From: Phillip Susi <psusi@ubuntu.com>
fc4a62
Date: Mon, 4 Nov 2013 13:10:09 -0500
fc4a62
Subject: [PATCH] libparted: make sure not to treat percentages as exact
fc4a62
 (#1045957)
fc4a62
fc4a62
If 1% of the drive size worked out ot be an even power of
fc4a62
two, it would trigger the exact placement.  Add an exception
fc4a62
for the percent units.
fc4a62
---
fc4a62
 NEWS             | 9 +++++++++
fc4a62
 libparted/unit.c | 2 +-
fc4a62
 2 files changed, 10 insertions(+), 1 deletion(-)
fc4a62
fc4a62
diff --git a/NEWS b/NEWS
fc4a62
index e2d01ed..80a62d6 100644
fc4a62
--- a/NEWS
fc4a62
+++ b/NEWS
fc4a62
@@ -1,5 +1,13 @@
fc4a62
 GNU parted NEWS                                    -*- outline -*-
fc4a62
 
fc4a62
+* Noteworthy changes in release 3.1-16 (2014-01-22) [RHEL7]
fc4a62
+
fc4a62
+** Bug Fixes
fc4a62
+
fc4a62
+  If a drive was 100 times an even multiple of two, sizes specified as
fc4a62
+  a percentage would trigger the exact placement rule and refuse to round
fc4a62
+  to the nearest half percent.
fc4a62
+
fc4a62
 * Noteworthy changes in release 3.1-4 (2012-06-08) [Fedora]
fc4a62
 
fc4a62
 ** Bug Fixes
fc4a62
@@ -8,6 +16,7 @@ GNU parted NEWS                                    -*- outline -*-
fc4a62
   libparted: Treat disks without a PMBR as msdos labeled disks
fc4a62
   even if they have GPT partition tables.
fc4a62
 
fc4a62
+
fc4a62
 * Noteworthy changes in release 3.1 (2012-03-02) [stable]
fc4a62
 
fc4a62
 ** New features
fc4a62
diff --git a/libparted/unit.c b/libparted/unit.c
fc4a62
index 66f2b6c..265cc68 100644
fc4a62
--- a/libparted/unit.c
fc4a62
+++ b/libparted/unit.c
fc4a62
@@ -548,7 +548,7 @@ ped_unit_parse_custom (const char* str, const PedDevice* dev, PedUnit unit,
fc4a62
 	   do not use 4MiB as the range.  Rather, presume that they
fc4a62
 	   are specifying precisely the starting or ending number,
fc4a62
 	   and treat "4MiB" just as we would treat "4194304B".  */
fc4a62
-	if (is_power_of_2 (unit_size))
fc4a62
+	if (is_power_of_2 (unit_size) && unit != PED_UNIT_PERCENT)
fc4a62
 		radius = 0;
fc4a62
 
fc4a62
 	*sector = num * unit_size / dev->sector_size;
fc4a62
-- 
fc4a62
1.8.4.2
fc4a62