diff options
author | ae <ae@FreeBSD.org> | 2011-05-08 12:20:30 +0000 |
---|---|---|
committer | ae <ae@FreeBSD.org> | 2011-05-08 12:20:30 +0000 |
commit | 1dcde07c6f492b21e00724d59d5a4be5dc642904 (patch) | |
tree | 734f789ac486767e2cae6ff10282c1fa9134c5f7 | |
parent | c6debcf559ce1a70224acaefc5b1d3e8ae3b1c77 (diff) | |
download | FreeBSD-src-1dcde07c6f492b21e00724d59d5a4be5dc642904.zip FreeBSD-src-1dcde07c6f492b21e00724d59d5a4be5dc642904.tar.gz |
Limit number of sectors that can be addressed.
MFC after: 1 week
-rw-r--r-- | sys/geom/part/g_part_ebr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/geom/part/g_part_ebr.c b/sys/geom/part/g_part_ebr.c index 5f665ca..f6278cc 100644 --- a/sys/geom/part/g_part_ebr.c +++ b/sys/geom/part/g_part_ebr.c @@ -288,7 +288,7 @@ g_part_ebr_create(struct g_part_table *basetable, struct g_part_parms *gpp) if (strcmp(psn, "MBR")) return (ENXIO); - msize = MIN(pp->mediasize / pp->sectorsize, 0xffffffff); + msize = MIN(pp->mediasize / pp->sectorsize, UINT32_MAX); msize -= msize % basetable->gpt_sectors; basetable->gpt_first = 0; basetable->gpt_last = msize - 1; @@ -464,7 +464,7 @@ g_part_ebr_read(struct g_part_table *basetable, struct g_consumer *cp) pp = cp->provider; table = (struct g_part_ebr_table *)basetable; - msize = pp->mediasize / pp->sectorsize; + msize = MIN(pp->mediasize / pp->sectorsize, UINT32_MAX); lba = 0; while (1) { |