parted/0013-libparted-BLKPG_RESIZE_PARTITION-uses-bytes-not-sect.patch

34 lines
1.1 KiB
Diff

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