HomeFreeBSD

Fix efi_use_whole_disk() when efi_nparts == 128.

Description

Fix efi_use_whole_disk() when efi_nparts == 128.

Commit e5dc681a changed EFI_NUMPAR from 9 to 128. This means that the
on-disk EFI label has efi_nparts = 128 instead of 9. The index of the
reserved partition, however, is still 8. This breaks
efi_use_whole_disk(), which uses efi_nparts-1 as the index of the
reserved partition.

This commit fixes efi_use_whole_disk() when the index of the reserved
partition is not efi_nparts-1. It rewrites the algorithm and makes it
more robust by using the order of the partitions instead of their
numbering. It assumes that the last non-empty partition is the reserved
partition, and that the non-empty partition before that is the data
partition.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #808

Details

Provenance
Etienne Dechamps <etienne.dechamps@ovh.net>Authored on Jul 11 2012, 3:47 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Jul 12 2012, 3:59 PM
Parents
rG7608bd0dd018: Use the right device path when relabeling.
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rGcee43a747750: Fix efi_use_whole_disk() when efi_nparts == 128. (authored by Etienne Dechamps <etienne.dechamps@ovh.net>).Jul 12 2012, 3:59 PM