[parted-devel] [PATCH] Always allow at least two sectors for extended boot record

Petr Uzel petr.uzel at suse.cz
Mon Apr 19 11:30:21 UTC 2010


On Tue, Apr 13, 2010 at 10:33:04PM -0400, Phillip Susi wrote:
> On Tue, 13 Apr 2010 18:29:56 +0200
> Petr Uzel <petr.uzel at suse.cz> wrote:
> 
> > Just a blind guess: did you run the test with parter with 'reintroduce
> > BLKPG' patch applied? AFAIK the bug doesn't show with BLKRRPART. 
> 
> The two issues are not related.  This is a confirmed bug in the kernel
> where it always sets the size of the extended partition to 2 sectors,
> even when the second sector is not there since it is the first sector of
> the logical partition.

ACK

> The BLKPG patch just causes the error to show
> up immediately instead of after a reboot, since without the patch
> BLKRRPART fails and the partition table is not read until reboot.

I don't think so. If the offset between extended and first logical partition is
only one sector, BLKPG definitely fails. But BLKRRART seems to handle such
situation just fine:

#> modprobe scsi_debug dev_size_mb=1
#> parted -s /dev/sdd mklabel msdos
#> parted -s /dev/sdd mkpart extended 64s 128s
#> strace -o strace.out parted -s /dev/sdd mkpart logical 65s 128s
#> parted -s /dev/sdd unit s print
Model: Linux scsi_debug (scsi)
Disk /dev/sdd: 2048s
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End   Size  Type      File system  Flags
 1      64s    128s  65s   extended               lba
 5      65s    128s  64s   logical

#> grep BLKRRPART strace.out 
ioctl(3, BLKRRPART, 0x6c)               = 0


So unless I missed something, I believe the partition table will be
successfully read after reboot (I didn't try, though).

Nonetheless, if parted is going to switch back from BLKRRPART to BLKPG
(I hope it will), your patch is definitely needed.



Petr

--
Petr Uzel, openSUSE Boosters Team
IRC: ptr_uzl @ freenode
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/parted-devel/attachments/20100419/130d58f4/attachment.pgp>


More information about the parted-devel mailing list