From owner-svn-src-head@FreeBSD.ORG Sun May 8 11:20:27 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 6F0381065673; Sun, 8 May 2011 11:20:27 +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 6220B8FC15; Sun, 8 May 2011 11:20:27 +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 p48BKR01043546; Sun, 8 May 2011 11:20:27 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p48BKRB7043544; Sun, 8 May 2011 11:20:27 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201105081120.p48BKRB7043544@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 8 May 2011 11:20:27 +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: r221645 - 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 11:20:27 -0000 Author: ae Date: Sun May 8 11:20:27 2011 New Revision: 221645 URL: http://svn.freebsd.org/changeset/base/221645 Log: Limit number of sectors that can be addressed. MFC after: 1 week Modified: head/sys/geom/part/g_part_pc98.c Modified: head/sys/geom/part/g_part_pc98.c ============================================================================== --- head/sys/geom/part/g_part_pc98.c Sun May 8 11:16:17 2011 (r221644) +++ head/sys/geom/part/g_part_pc98.c Sun May 8 11:20:27 2011 (r221645) @@ -261,7 +261,7 @@ g_part_pc98_create(struct g_part_table * cyl = basetable->gpt_heads * basetable->gpt_sectors; - msize = MIN(pp->mediasize / SECSIZE, 0xffffffff); + msize = MIN(pp->mediasize / SECSIZE, UINT_MAX); basetable->gpt_first = cyl; basetable->gpt_last = msize - (msize % cyl) - 1; @@ -451,7 +451,7 @@ g_part_pc98_read(struct g_part_table *ba pp = cp->provider; table = (struct g_part_pc98_table *)basetable; - msize = pp->mediasize / SECSIZE; + msize = MIN(pp->mediasize / SECSIZE, UINT_MAX); buf = g_read_data(cp, 0L, BOOTSIZE, &error); if (buf == NULL)