svn commit: r254642 - stable/8/sys/geom/part
Andrey V. Elsukov
ae at FreeBSD.org
Thu Aug 22 06:24:03 UTC 2013
Author: ae
Date: Thu Aug 22 06:24:02 2013
New Revision: 254642
URL: http://svnweb.freebsd.org/changeset/base/254642
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/8/sys/geom/part/g_part_gpt.c
Directory Properties:
stable/8/sys/ (props changed)
stable/8/sys/geom/ (props changed)
Modified: stable/8/sys/geom/part/g_part_gpt.c
==============================================================================
--- stable/8/sys/geom/part/g_part_gpt.c Thu Aug 22 06:20:25 2013 (r254641)
+++ stable/8/sys/geom/part/g_part_gpt.c Thu Aug 22 06:24:02 2013 (r254642)
@@ -793,9 +793,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-8
mailing list