summaryrefslogtreecommitdiffstats
path: root/sys/geom
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2009-03-30 00:53:46 +0000
committermarcel <marcel@FreeBSD.org>2009-03-30 00:53:46 +0000
commit658fba6dacb297008f126780a018b71c2e1f98c2 (patch)
tree9c7493eedf29919e361cc16010c6817ac1bf7120 /sys/geom
parent5f1a50b47c3e1177f3ae625df08af3f4b3667233 (diff)
downloadFreeBSD-src-658fba6dacb297008f126780a018b71c2e1f98c2.zip
FreeBSD-src-658fba6dacb297008f126780a018b71c2e1f98c2.tar.gz
Sharpen the saw:
o MBR uses 32-bit block numbers. Limit the scheme to 2^32-1 blocks when the media is larger.
Diffstat (limited to 'sys/geom')
-rw-r--r--sys/geom/part/g_part_mbr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/geom/part/g_part_mbr.c b/sys/geom/part/g_part_mbr.c
index e058b05..72d0ecb 100644
--- a/sys/geom/part/g_part_mbr.c
+++ b/sys/geom/part/g_part_mbr.c
@@ -230,7 +230,7 @@ g_part_mbr_create(struct g_part_table *basetable, struct g_part_parms *gpp)
struct g_consumer *cp;
struct g_provider *pp;
struct g_part_mbr_table *table;
- uint64_t msize;
+ uint32_t msize;
pp = gpp->gpp_provider;
cp = LIST_FIRST(&pp->consumers);
@@ -238,7 +238,7 @@ g_part_mbr_create(struct g_part_table *basetable, struct g_part_parms *gpp)
if (pp->sectorsize < MBRSIZE)
return (ENOSPC);
- msize = pp->mediasize / pp->sectorsize;
+ msize = MIN(pp->mediasize / pp->sectorsize, 0xffffffff);
basetable->gpt_first = basetable->gpt_sectors;
basetable->gpt_last = msize - (msize % basetable->gpt_sectors) - 1;
OpenPOWER on IntegriCloud