Blame SOURCES/0013-libparted-BLKPG_RESIZE_PARTITION-uses-bytes-not-sect.patch

0cb0b9
From 1174a9cca1610611ad5d8cf9f3611e9d4c984fb0 Mon Sep 17 00:00:00 2001
0cb0b9
From: "Brian C. Lane" <bcl@redhat.com>
0cb0b9
Date: Fri, 5 Jun 2015 14:40:00 -0700
0cb0b9
Subject: [PATCH 13/13] libparted: BLKPG_RESIZE_PARTITION uses bytes, not
0cb0b9
 sectors (#1135493)
0cb0b9
0cb0b9
This results in the extended partition vanishing after adding another
0cb0b9
partition.
0cb0b9
0cb0b9
Resolves: rhbz#1135493
0cb0b9
---
0cb0b9
 libparted/arch/linux.c | 5 ++++-
0cb0b9
 1 file changed, 4 insertions(+), 1 deletion(-)
0cb0b9
0cb0b9
diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
0cb0b9
index 90ab21d..e73fe1c 100644
0cb0b9
--- a/libparted/arch/linux.c
0cb0b9
+++ b/libparted/arch/linux.c
0cb0b9
@@ -2547,7 +2547,10 @@ static int _blkpg_resize_partition (PedDisk* disk, const PedPartition *part)
0cb0b9
                                 if (walk->geom.start == part->geom.start+1)
0cb0b9
                                         linux_part.length = 1;
0cb0b9
                         }
0cb0b9
-                } else linux_part.length = 1;
0cb0b9
+                } else {
0cb0b9
+                        linux_part.length = 1;
0cb0b9
+                }
0cb0b9
+                linux_part.length *= disk->dev->sector_size;
0cb0b9
         }
0cb0b9
         else
0cb0b9
                 linux_part.length = part->geom.length * disk->dev->sector_size;
0cb0b9
-- 
0cb0b9
2.4.0
0cb0b9