[parted-devel] [PATCH 2/2] libparted: BLKPG_RESIZE_PARTITION uses bytes, not sectors (#1135493)

Brian C. Lane bcl at redhat.com
Fri Jun 5 22:25:21 UTC 2015


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




More information about the parted-devel mailing list