OSDN Git Service

_disk_sync_part_table: revise yet again
authorJim Meyering <meyering@redhat.com>
Mon, 26 Jan 2009 15:24:52 +0000 (16:24 +0100)
committerJim Meyering <meyering@redhat.com>
Mon, 26 Jan 2009 18:08:07 +0000 (19:08 +0100)
This fixes a bug whereby parted could leave the kernel with an
erroneous view of a partition table.
* libparted/arch/linux.c (_disk_sync_part_table): Per analysis in
http://thread.gmane.org/gmane.comp.gnu.parted.devel/2297/focus=2307.
Patch suggested by Petr Uzel.

libparted/arch/linux.c

index 83e24c8..3527f5d 100644 (file)
@@ -1,5 +1,5 @@
 /* libparted - a library for manipulating disk partitions
-    Copyright (C) 1999 - 2005, 2007, 2008 Free Software Foundation, Inc.
+    Copyright (C) 1999 - 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -2251,7 +2251,7 @@ _disk_sync_part_table (PedDisk* disk)
         if (largest_partnum <= 0)
           return 1;
 
-        int     last = PED_MIN (largest_partnum, 16);
+        int     last = 16;
         int*    rets = ped_malloc(sizeof(int) * last);
         int*    errnums = ped_malloc(sizeof(int) * last);
         int     ret = 1;