mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-20 08:44:33 +00:00
gpt_entries is used as limit for the number of partition entries in
the GEOM_PART. Instead of just using number of entries from the GPT header, calculate this limit based on the reserved space between GPT header and first available LBA. MFC after: 2 weeks
This commit is contained in:
parent
a61914445d
commit
b74dd6c77b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=254095
|
@ -916,9 +916,10 @@ g_part_gpt_read(struct g_part_table *basetable, struct g_consumer *cp)
|
|||
|
||||
basetable->gpt_first = table->hdr->hdr_lba_start;
|
||||
basetable->gpt_last = table->hdr->hdr_lba_end;
|
||||
basetable->gpt_entries = table->hdr->hdr_entries;
|
||||
basetable->gpt_entries = (table->hdr->hdr_lba_start - 2) *
|
||||
pp->sectorsize / table->hdr->hdr_entsz;
|
||||
|
||||
for (index = basetable->gpt_entries - 1; index >= 0; index--) {
|
||||
for (index = table->hdr->hdr_entries - 1; index >= 0; index--) {
|
||||
if (EQUUID(&tbl[index].ent_type, &gpt_uuid_unused))
|
||||
continue;
|
||||
entry = (struct g_part_gpt_entry *)g_part_new_entry(
|
||||
|
|
Loading…
Reference in a new issue