From owner-freebsd-current@FreeBSD.ORG Sat Sep 19 04:23:02 2009 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B878E106566C; Sat, 19 Sep 2009 04:23:02 +0000 (UTC) (envelope-from nyan@jp.FreeBSD.org) Received: from sakura.ccs.furiru.org (sakura.ccs.furiru.org [IPv6:2001:2f0:104:8060::1]) by mx1.freebsd.org (Postfix) with ESMTP id 59E168FC0A; Sat, 19 Sep 2009 04:23:02 +0000 (UTC) Received: from localhost (authenticated bits=0) by sakura.ccs.furiru.org (unknown) with ESMTP id n8J4MvYA000737; Sat, 19 Sep 2009 13:23:01 +0900 (JST) (envelope-from nyan@jp.FreeBSD.org) Date: Sat, 19 Sep 2009 13:22:11 +0900 (JST) Message-Id: <20090919.132211.27814754.nyan@jp.FreeBSD.org> To: lulf@FreeBSD.org, marcel@FreeBSD.org From: Takahashi Yoshihiro X-Mailer: Mew version 6.2 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Sat_Sep_19_13_22_11_2009_575)--" Content-Transfer-Encoding: 7bit Cc: current@freebsd.org Subject: Sanitizing a geometry in libdisk X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2009 04:23:02 -0000 ----Next_Part(Sat_Sep_19_13_22_11_2009_575)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit The Sanitize_Bios_Geom() is always called after r188408. But the function has a problem of checking a disk size. So it causes to using incorrect geometry. I think that it's the same problem in g_part_bsd_read()@g_part_bsd.c The attached patch is useful for pc98 at least so it should be in 8.0. Please review it. --- TAKAHASHI Yoshihiro ----Next_Part(Sat_Sep_19_13_22_11_2009_575)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="l.diff" Index: change.c =================================================================== --- change.c (revision 197322) +++ change.c (working copy) @@ -47,9 +47,11 @@ Sanitize_Bios_Geom(struct disk *disk) if (disk->bios_sect > 63) sane = 0; #endif +#if 0 /* Disable a check on a disk size. It's too strict. */ if (disk->bios_cyl * disk->bios_hd * disk->bios_sect != disk->chunks->size) sane = 0; +#endif if (sane) return; ----Next_Part(Sat_Sep_19_13_22_11_2009_575)----