From owner-svn-src-head@FreeBSD.ORG Sun May 8 12:11:17 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5771E106564A; Sun, 8 May 2011 12:11:17 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4ADE78FC16; Sun, 8 May 2011 12:11:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p48CBH1j045325; Sun, 8 May 2011 12:11:17 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p48CBHgF045323; Sun, 8 May 2011 12:11:17 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201105081211.p48CBHgF045323@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 8 May 2011 12:11:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221652 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 12:11:17 -0000 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)