summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorae <ae@FreeBSD.org>2011-05-08 12:11:16 +0000
committerae <ae@FreeBSD.org>2011-05-08 12:11:16 +0000
commita0e3009476be448d59844c5c97bc2c7eeeab4efa (patch)
tree68c023c62bb200db5e3814930702bd9be38f793c
parent174adce103c5185d7009a169a8a3cfb469da3a6a (diff)
downloadFreeBSD-src-a0e3009476be448d59844c5c97bc2c7eeeab4efa.zip
FreeBSD-src-a0e3009476be448d59844c5c97bc2c7eeeab4efa.tar.gz
Limit number of sectors that can be addressed.
MFC after: 1 week
-rw-r--r--sys/geom/part/g_part_bsd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/geom/part/g_part_bsd.c b/sys/geom/part/g_part_bsd.c
index 61fe89a..269b943 100644
--- a/sys/geom/part/g_part_bsd.c
+++ b/sys/geom/part/g_part_bsd.c
@@ -206,7 +206,7 @@ g_part_bsd_create(struct g_part_table *basetable, struct g_part_parms *gpp)
if (BBSIZE % pp->sectorsize)
return (ENOTBLK);
- msize = MIN(pp->mediasize / pp->sectorsize, 0xffffffff);
+ msize = MIN(pp->mediasize / pp->sectorsize, UINT32_MAX);
secpercyl = basetable->gpt_sectors * basetable->gpt_heads;
ncyls = msize / secpercyl;
@@ -365,7 +365,7 @@ g_part_bsd_read(struct g_part_table *basetable, struct g_consumer *cp)
pp = cp->provider;
table = (struct g_part_bsd_table *)basetable;
- msize = pp->mediasize / pp->sectorsize;
+ msize = MIN(pp->mediasize / pp->sectorsize, UINT32_MAX);
table->bbarea = g_read_data(cp, 0, BBSIZE, &error);
if (table->bbarea == NULL)
OpenPOWER on IntegriCloud