Limit number of sectors that can be addressed.

MFC after:	1 week
This commit is contained in:
Andrey V. Elsukov 2011-05-08 12:20:30 +00:00
parent 7dc2d68994
commit 284a82d0bb

View File

@ -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) {