[parted-devel] partprobe gives errors with dvh partition no. >16

Petr Uzel petr.uzel at suse.cz
Tue Jun 24 13:11:57 UTC 2008


Hi list,

I believe there's a bug in parted/partprobe. However, I don't fully understand 
its background, so I rather describe steps to reproduce and possible solution 
(of course I'm not sure it is correct).

How to reproduce:

create SGI partition table with following layout :
========================================================================
foxbat:~ # fdisk -l /dev/sdb

Disk /dev/sdb (SGI disk label): 255 heads, 63 sectors, 1870 cylinders
Units = cylinders of 16065 * 512 bytes

----- partitions -----
Pt#    Device  Info     Start       End   Sectors  Id  System
 9: /dev/sdb1               0         0      4096   0  SGI volhdr
11: /dev/sdb2               0      1870  30043440   6  SGI volume
----- Bootinfo -----
Bootfile: /unix
----- Directory Entries -----
 0: backvh     sector    4 size 1391368
========================================================================

(The backvh 'directory entry' was created using dvhtool --unix-to-vh ).


Then run partprobe:
========================================================================
foxbat:~ # partprobe -s /dev/sdb
Error: Error informing the kernel about modifications to 
partition /dev/sdb17 -- Invalid argument.  This means Linux won't know about 
any changes you made to /dev/sdb17 until you reboot -- so you shouldn't mount 
it or use it in any way before rebooting.
/dev/sdb: dvh partitions 9 <17>
========================================================================

I think that the problem is in function _disk_sync_part_table() in 
libparted/arch/linux.c. When determining last partition which is to be 
removed/added, PED_MIN() has to be used instead of PED_MAX(). This ensures 
that it would be never done for partition with number greater than 16.

If I am right, some description/comment of the magic number 16 used in the 
code would be useful.

Same problem (if it is actually a problem) is in _dm_reread_part_table().

I would attach a patch, but since I didn't sign the FSF copyright assignment I 
rather didn't do so ;)



-- 
Best regards / s pozdravem

Petr Uzel, Packages maintainer
---------------------------------------------------------------------
SUSE LINUX, s.r.o.                          e-mail: petr.uzel 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