OSDN Git Service

libparted: avoid unwarranted failed assertion during mklabel
authorJim Meyering <meyering@redhat.com>
Sun, 26 Feb 2012 17:04:37 +0000 (18:04 +0100)
committerJim Meyering <meyering@redhat.com>
Sun, 26 Feb 2012 17:04:37 +0000 (18:04 +0100)
commit4559c510f02a691d90329fd646e8eefe2e73e6d2
tree3c8e3b3de09db0e5b11872992faa4cfc7f7a0054
parent187e7cba48094505f00532698dfb04ab40575231
libparted: avoid unwarranted failed assertion during mklabel

This could happen when running "parted -s $dev mklabel $type" for
nearly any $type, assuming the underlying disk's sector size is
larger than 512 bytes.  This particular failure was noticed by
running tests/t9050-partition-table-types.sh with a simulated
sector size of 1024, as is done as part of a top-level "make check",
but so far, this failure has shown up only on RHEL-6.2.
That test attempts to exercise an ugly part of partition table
creation: during creation, parted checks for an existing
partition table by iterating through its list of known types and
attempting to read the disk, looking for a preexisting table.
Knowing this, the test takes all pairs of partition table types,
<A,B> and first creates a type of type A, and then creates on top
of that (erasing the original) a table of type B.
* libparted/labels/mac.c (_disk_analyse_ghost_size): Remove bogus
assertion.  If the number of the sector with a matching signature
is too large, simply reject it by returning 0.
* NEWS (Bug fixes): Mention this.
NEWS
libparted/labels/mac.c