From owner-freebsd-bugs Sat Oct 26 08:10:04 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id IAA00960 for bugs-outgoing; Sat, 26 Oct 1996 08:10:04 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id IAA00952; Sat, 26 Oct 1996 08:10:02 -0700 (PDT) Resent-Date: Sat, 26 Oct 1996 08:10:02 -0700 (PDT) Resent-Message-Id: <199610261510.IAA00952@freefall.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, barry@scottb.demon.co.uk Received: from scottb.demon.co.uk (scottb.demon.co.uk [158.152.42.64]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id IAA00743 for ; Sat, 26 Oct 1996 08:06:38 -0700 (PDT) Received: (from barry@localhost) by scottb.demon.co.uk (8.7.5/8.7.3) id QAA00610; Sat, 26 Oct 1996 16:06:08 +0100 (BST) Message-Id: <199610261506.QAA00610@scottb.demon.co.uk> Date: Sat, 26 Oct 1996 16:06:08 +0100 (BST) From: Barry Alan Scott Reply-To: barry@scottb.demon.co.uk To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: i386/1893: partition tables not processed correctly to guess geometry Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >Number: 1893 >Category: i386 >Synopsis: partition tables not processed correctly to guess geometry >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Oct 26 08:10:01 PDT 1996 >Last-Modified: >Originator: Barry Alan Scott >Organization: None >Release: FreeBSD 2.1-STABLE i386 and all SNAP's to date >Environment: Bug is all FreeBSB since 2.1.5 atleast. >Description: John Gumb and myself are experimenting with supporting the Fujitsu 640MB MO drives at the 2048 sector size. We found that FreeBSD does not process partition tables correctly to size a disk. The following code at line 253 in diskslice_machdep.c is badly broken. It is supposed to calculate the max number of cylinders but infact reports the number of cylinders in the 4th slot. Old code from diskslice_machdep.c around line 253: /* Guess the geometry. */ /* * TODO: * Perhaps skip entries with 0 size. * Perhaps only look at entries of type DOSPTYP_386BSD. */ max_ncyls = 0; max_nsectors = 0; max_ntracks = 0; for (dospart = 0, dp = dp0; dospart < NDOSPART; dospart++, dp++) { int nsectors; int ntracks; >How-To-Repeat: Make partition slot 4 describe a small part of the whole disk. Then the orginal code will get the size of the disk wrong. >Fix: See above. >Audit-Trail: >Unformatted: >bug> max_ncyls = DPCYL(dp->dp_ecyl, dp->dp_esect); >bug> if (max_ncyls < max_ncyls) >bug> max_ncyls = max_ncyls; nsectors = DPSECT(dp->dp_esect); if (max_nsectors < nsectors) max_nsectors = nsectors; ntracks = dp->dp_ehd + 1; if (max_ntracks < ntracks) max_ntracks = ntracks; } The lines maked ">bug>" are clearly intended to read int ncyls; ncyls = DPCYL(dp->dp_ecyl, dp->dp_esect); if (max_ncyls < ncyls) max_ncyls = ncyls; We do not know what the full impact of this bug is. Is this related to the "random" MSDOS problems some people see? John Gumb can be contacted as john@talisker.demon.co.uk Barry Scott can be contacted as barry@scottb.demon.co.uk and as tsbarry@nortel.ca (atleast till 31-dec)