From owner-svn-src-head@FreeBSD.ORG Mon Mar 30 01:03:59 2009 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 35B97106566B; Mon, 30 Mar 2009 01:03:59 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 242E38FC0A; Mon, 30 Mar 2009 01:03:59 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2U13wWq049478; Mon, 30 Mar 2009 01:03:58 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2U13wFN049477; Mon, 30 Mar 2009 01:03:58 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200903300103.n2U13wFN049477@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 30 Mar 2009 01:03:58 +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: r190537 - 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: Mon, 30 Mar 2009 01:03:59 -0000 Author: marcel Date: Mon Mar 30 01:03:58 2009 New Revision: 190537 URL: http://svn.freebsd.org/changeset/base/190537 Log: Sharpen the saw: o PC98 uses 32-bit block numbers. Limit the scheme to 2^32-1 blocks when the media is larger. The 32-bit block numbers are implicit (16-bit cylinder * 8-bit head * 8-bit sector). 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 Mon Mar 30 00:53:46 2009 (r190536) +++ head/sys/geom/part/g_part_pc98.c Mon Mar 30 01:03:58 2009 (r190537) @@ -218,8 +218,7 @@ g_part_pc98_create(struct g_part_table * struct g_consumer *cp; struct g_provider *pp; struct g_part_pc98_table *table; - uint64_t msize; - uint32_t cyl; + uint32_t cyl, msize; pp = gpp->gpp_provider; cp = LIST_FIRST(&pp->consumers); @@ -231,7 +230,7 @@ g_part_pc98_create(struct g_part_table * cyl = basetable->gpt_heads * basetable->gpt_sectors; - msize = pp->mediasize / SECSIZE; + msize = MIN(pp->mediasize / SECSIZE, 0xffffffff); basetable->gpt_first = cyl; basetable->gpt_last = msize - (msize % cyl) - 1;