Date: Sun, 8 May 2011 12:11:17 +0000 (UTC) From: "Andrey V. Elsukov" <ae@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r221652 - head/sys/geom/part Message-ID: <201105081211.p48CBHgF045323@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ae Date: Sun May 8 12:11:16 2011 New Revision: 221652 URL: http://svn.freebsd.org/changeset/base/221652 Log: Limit number of sectors that can be addressed. MFC after: 1 week Modified: head/sys/geom/part/g_part_bsd.c Modified: head/sys/geom/part/g_part_bsd.c ============================================================================== --- head/sys/geom/part/g_part_bsd.c Sun May 8 12:06:12 2011 (r221651) +++ head/sys/geom/part/g_part_bsd.c Sun May 8 12:11:16 2011 (r221652) @@ -206,7 +206,7 @@ g_part_bsd_create(struct g_part_table *b 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 *bas 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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105081211.p48CBHgF045323>