diff options
author | marcel <marcel@FreeBSD.org> | 2009-03-27 05:48:42 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2009-03-27 05:48:42 +0000 |
commit | 1525b2b738e72cc7a7f99298340391c1e0fb144e (patch) | |
tree | 3ee5cdc8971558a85e6f6da3a15290d9c4c93708 /sys/geom/part | |
parent | 0d55e76419374bc2ac6b65a38edac1cf25ff8c76 (diff) | |
download | FreeBSD-src-1525b2b738e72cc7a7f99298340391c1e0fb144e.zip FreeBSD-src-1525b2b738e72cc7a7f99298340391c1e0fb144e.tar.gz |
Sharpen the saw:
o BSD uses 32-bit block numbers. Limit the scheme to 2^32-1
blocks when the media is larger.
Diffstat (limited to 'sys/geom/part')
-rw-r--r-- | sys/geom/part/g_part_bsd.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/geom/part/g_part_bsd.c b/sys/geom/part/g_part_bsd.c index 34548b4..b476bfd 100644 --- a/sys/geom/part/g_part_bsd.c +++ b/sys/geom/part/g_part_bsd.c @@ -192,8 +192,7 @@ g_part_bsd_create(struct g_part_table *basetable, struct g_part_parms *gpp) struct g_part_bsd_entry *entry; struct g_part_bsd_table *table; u_char *ptr; - uint64_t msize; - uint32_t ncyls, secpercyl; + uint32_t msize, ncyls, secpercyl; pp = gpp->gpp_provider; cp = LIST_FIRST(&pp->consumers); @@ -203,7 +202,7 @@ g_part_bsd_create(struct g_part_table *basetable, struct g_part_parms *gpp) if (BBSIZE % pp->sectorsize) return (ENOTBLK); - msize = pp->mediasize / pp->sectorsize; + msize = MIN(pp->mediasize / pp->sectorsize, 0xffffffff); secpercyl = basetable->gpt_sectors * basetable->gpt_heads; ncyls = msize / secpercyl; |