aboutsummaryrefslogtreecommitdiff
path: root/sys/geom/part
diff options
context:
space:
mode:
authorAndrey V. Elsukov <ae@FreeBSD.org>2013-08-08 16:09:20 +0000
committerAndrey V. Elsukov <ae@FreeBSD.org>2013-08-08 16:09:20 +0000
commitb74dd6c77b5372f57858521f08d85d183a3231eb (patch)
tree9422c97ade76f0cdf4e17c58da14141ed2036064 /sys/geom/part
parenta61914445dfe85e9fb8e9347a5c17d48e94fb0f9 (diff)
Notes
Diffstat (limited to 'sys/geom/part')
-rw-r--r--sys/geom/part/g_part_gpt.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/geom/part/g_part_gpt.c b/sys/geom/part/g_part_gpt.c
index 12b0f8920b901..8634b1e923769 100644
--- a/sys/geom/part/g_part_gpt.c
+++ b/sys/geom/part/g_part_gpt.c
@@ -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(