[parted-devel] [BUG] _disk_sync_part_table() is broken

Petr Uzel petr.uzel at suse.cz
Wed Nov 12 12:16:26 UTC 2008


On Tue, Nov 11, 2008 at 09:37:13AM -0500, Joel Granados wrote:
> I saw this same behavior when doing the same test.
> Did a `git revert  f6bd20573e3ecfb63f62d88c52a0870fb8851b59` and after getting 
> some git-revert conflicts out of the way I retested and found that the issue was no more.
                                                      
git-revert 1742b051d78493b90bcb801e68a2be0277bcf72f solves these
conflicts.

 
> We should probably do a revert of that specific commit :)

With the commit reverted, we will get rid of the regression.  However,
there will still remain some issues with deleting partitions, as I
wrote in previous mail.

> > Analysis: 
> > ---------
> > 
> > When the partition is deleted, parted first updates its in-memory
> > representation of partition table [1], then it writes the partition
> > table a
> > then it commits the changes to OS. On newer kernels, the disk commit
> > is done by
> > _disk_sync_part_table() called from linux_disk_commit().
> > 
> > This function needs to inform the kernel that partition #1 was
> > deleted. To find
> > out what partitions it should iterate over, it uses MIN(16,
> > ped_disk_get_last_partition_num(disk)). 
> > But the problem is that ped_disk_get_last_partition_num() uses
> > in-memory
> > representation of partition table, in which the partition table has
> > no
> > partitions (see [1]), and thus it returns -1.
> > 
> > The result is that parted does not inform the kernel that partition #1
> > was deleted.
> > 
> > Previous state:
> > ---------------
> > 
> > Before the broken commit was checked in, parted used PED_MAX(16,
> > last_partition_num())
> > to determine which partitions might be changed. But this also is not
> > correct, because : 
> > 1. for <= 16 partitions on the disk, the last_partition_num() call is
> > useless 
> > 2. if there's >16 partitions, the last_partition_num() might return
> > inconsistent
> > result (in case the last partition was just deleted)

-- 
Best regards / s pozdravem

Petr Uzel, Packages maintainer
---------------------------------------------------------------------
SUSE LINUX, s.r.o.                          e-mail: puzel at suse.cz
Lihovarská 1060/12                          tel: +420 284 028 964
190 00 Prague 9                             fax: +420 284 028 951
Czech Republic                              http://www.suse.cz



More information about the parted-devel mailing list