diff --git a/largest_partition_number.patch b/largest_partition_number.patch index 6eb9301..00ea300 100644 --- a/largest_partition_number.patch +++ b/largest_partition_number.patch @@ -1,22 +1,34 @@ -diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c -index 4c9a2d3..b6453a5 100644 ---- a/libparted/arch/linux.c -+++ b/libparted/arch/linux.c -@@ -2212,7 +2212,7 @@ static int +--- ./libparted/arch/linux.c.orig 2008-10-07 10:47:43.000000000 +0200 ++++ ./libparted/arch/linux.c 2008-10-07 10:45:04.000000000 +0200 +@@ -2163,11 +2163,15 @@ _blkpg_remove_partition (PedDisk* disk, + static int _disk_sync_part_table (PedDisk* disk) { - int i; +- int i; - int last = PED_MAX (ped_disk_get_last_partition_num (disk), 16); -+ int last = PED_MIN (ped_disk_get_last_partition_num (disk), 16); ++ int largest_partnum = ped_disk_get_last_partition_num (disk); ++ if (largest_partnum <= 0) ++ return 1; ++ ++ int last = PED_MIN (largest_partnum, 16); int* rets = ped_malloc(sizeof(int) * last); int* errnums = ped_malloc(sizeof(int) * last); int ret = 1; -@@ -2432,7 +2432,7 @@ static int ++ int i; + + for (i = 1; i <= last; i++) { + rets[i - 1] = _blkpg_remove_partition (disk, i); +@@ -2384,8 +2388,12 @@ err: + static int _dm_reread_part_table (PedDisk* disk) { ++ int largest_partnum = ped_disk_get_last_partition_num (disk); ++ if (largest_partnum <= 0) ++ return 1; ++ int rc = 1; - int last = PED_MAX (ped_disk_get_last_partition_num (disk), 16); -+ int last = PED_MIN (ped_disk_get_last_partition_num (disk), 16); ++ int last = PED_MIN (largest_partnum, 16); int i; sync(); diff --git a/parted.changes b/parted.changes index aad618c..653355e 100644 --- a/parted.changes +++ b/parted.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Oct 7 10:55:11 CEST 2008 - puzel@suse.cz + +- updated largest_partition_number.patch (bnc#428992) + ------------------------------------------------------------------- Thu Aug 28 18:38:02 CEST 2008 - kukuk@suse.de diff --git a/parted.spec b/parted.spec index a4dfd3e..4978dee 100644 --- a/parted.spec +++ b/parted.spec @@ -26,7 +26,7 @@ License: GPL v2 or later Group: System/Filesystems Summary: GNU partitioner Version: 1.8.8 -Release: 78 +Release: 87 Source0: %{name}-%{version}.tar.bz2 Patch: always-resize-part.dif Patch1: parted-type.patch @@ -97,7 +97,7 @@ Authors: %patch12 %patch51 -p1 %patch52 -p1 -%patch53 -p1 +%patch53 %patch54 %patch55 -p1 %patch56 -p1 @@ -145,6 +145,8 @@ rm -rf "$RPM_BUILD_ROOT" %{_libdir}/*.so %changelog +* Tue Oct 07 2008 puzel@suse.cz +- updated largest_partition_number.patch (bnc#428992) * Thu Aug 28 2008 kukuk@suse.de - Kill *.la file * Mon Aug 25 2008 prusnak@suse.cz