svn commit: r221652 - head/sys/geom/part

Andrey V. Elsukov ae at FreeBSD.org
Sun May 8 12:11:17 UTC 2011


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)


More information about the svn-src-all mailing list