OSDN Git Service

sun: initialize basic partition table fields
authorKarel Zak <kzak@redhat.com>
Fri, 19 Feb 2010 15:12:52 +0000 (16:12 +0100)
committerJim Meyering <meyering@redhat.com>
Thu, 25 Feb 2010 17:22:19 +0000 (18:22 +0100)
commit0fe636d803496c0fff7ab0944d4d8c3b01c6d929
treeb10b0bba2e57bb0086b60517dfb0cf02b70883c5
parentd462d59f8c290edcc053b6677143d745c4d51d67
sun: initialize basic partition table fields

libparted completely ignores basic fields (version, nparts and sanity)
in the sun VTOC, then for example fdisk prints warnings for such
partition table:

# fdisk -lu /dev/sdb
Detected sun disklabel with wrong version [0x00000000].
Detected sun disklabel with wrong sanity [0x00000000].
Detected sun disklabel with wrong num_partitions [0].

It seems that the current libparted sun support follows old Linux
kernel code, but the code was changed 3 years ago (see kernel commit
3961bae0ac030a70ae2e0578270203889021f1a1).

Note that the number of partitions (nparts) is optional for Linux
kernel, but fdisk(8) strictly requires SUN_DISK_MAXPARTITIONS (=8)
there. This patch sets nparts to SUN_DISK_MAXPARTITIONS rather then
use a real number of partitions.

* NEWS (Bug fixes): Mention it.
* libparted/labels/sun.c: Update from kernel.
* tests/t4001-sun-vtoc.sh: New file.  Test for this.
NEWS
libparted/labels/sun.c
tests/t4001-sun-vtoc.sh [new file with mode: 0755]