freebsd-dev/sys/geom/part
Marcel Moolenaar 96937e3b23 Revert revision 254095
In revision 254095, gpt_entries is not set to match the on-disk
hdr_entries, but rather is computed based on available space.
There are 2 problems with this:

1.  The GPT backend respects hdr_entries and only reads and writes
    that number of partition entries.  On top of that, CRC32 is
    computed over the table that has hdr_entries elements.  When
    the common code works on what is possibly a larger number, the
    behaviour becomes inconsistent and problematic.  In particular,
    it would be possible to add a new partition that on a reboot
    isn't there anymore.
2.  The calculation of gpt_entries is based on flawed assumptions.
    The GPT specification does not dictate that sectors are layed
    out in a particular way that the available space can be
    determined by looking at LBAs.  In practice, implementations
    do the same thing, because there's no reason to do it any
    other way.  Still, GPT allows certain freedoms that can be
    exploited in some form or shape if the need arises.

PR:		229977
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D19438
2019-03-05 04:15:34 +00:00
..
g_part_apm.c Annotate geom modules with MODULE_VERSION 2018-04-10 19:18:16 +00:00
g_part_bsd64.c Annotate geom modules with MODULE_VERSION 2018-04-10 19:18:16 +00:00
g_part_bsd.c Annotate geom modules with MODULE_VERSION 2018-04-10 19:18:16 +00:00
g_part_ebr.c gpart: add EFI alias for MBR partition scheme 2018-06-17 20:10:48 +00:00
g_part_gpt.c Revert revision 254095 2019-03-05 04:15:34 +00:00
g_part_if.m sys/geom: spelling fixes in comments. 2016-04-29 20:56:58 +00:00
g_part_ldm.c Sort geom/part mbr/ebr/ldm alias table entries 2018-06-17 20:06:27 +00:00
g_part_mbr.c Add a “skip_dsn” option to g_part's bootcode verb to prevent g_part_mbr 2018-11-27 14:58:19 +00:00
g_part_vtoc8.c Annotate geom modules with MODULE_VERSION 2018-04-10 19:18:16 +00:00
g_part.c Add a “skip_dsn” option to g_part's bootcode verb to prevent g_part_mbr 2018-11-27 14:58:19 +00:00
g_part.h Add a “skip_dsn” option to g_part's bootcode verb to prevent g_part_mbr 2018-11-27 14:58:19 +00:00