svn commit: r254641 - stable/9/sys/geom/part
Andrey V. Elsukov
ae at FreeBSD.org
Thu Aug 22 06:20:26 UTC 2013
Author: ae
Date: Thu Aug 22 06:20:25 2013
New Revision: 254641
URL: http://svnweb.freebsd.org/changeset/base/254641
Log:
MFC r254095:
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.
Modified:
stable/9/sys/geom/part/g_part_gpt.c
Directory Properties:
stable/9/sys/ (props changed)
Modified: stable/9/sys/geom/part/g_part_gpt.c
==============================================================================
--- stable/9/sys/geom/part/g_part_gpt.c Thu Aug 22 05:53:47 2013 (r254640)
+++ stable/9/sys/geom/part/g_part_gpt.c Thu Aug 22 06:20:25 2013 (r254641)
@@ -903,9 +903,10 @@ g_part_gpt_read(struct g_part_table *bas
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(
More information about the svn-src-stable-9
mailing list