From owner-freebsd-bugs Mon Oct 28 16:20: 3 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A7BFC37B401 for ; Mon, 28 Oct 2002 16:20:01 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id E2FD543E4A for ; Mon, 28 Oct 2002 16:20:00 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g9T0K0x3046823 for ; Mon, 28 Oct 2002 16:20:00 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g9T0K0kt046822; Mon, 28 Oct 2002 16:20:00 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1C09F37B404 for ; Mon, 28 Oct 2002 16:16:10 -0800 (PST) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id AC30943E4A for ; Mon, 28 Oct 2002 16:16:09 -0800 (PST) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.12.6/8.12.6) with ESMTP id g9T0G97R007601 for ; Mon, 28 Oct 2002 16:16:09 -0800 (PST) (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.12.6/8.12.6/Submit) id g9T0G9MA007600; Mon, 28 Oct 2002 16:16:09 -0800 (PST) Message-Id: <200210290016.g9T0G9MA007600@www.freebsd.org> Date: Mon, 28 Oct 2002 16:16:09 -0800 (PST) From: Mikel Lechner To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: i386/44581: ar RAID driver crashes using older DISKS Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 44581 >Category: i386 >Synopsis: ar RAID driver crashes using older DISKS >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Oct 28 16:20:00 PST 2002 >Closed-Date: >Last-Modified: >Originator: Mikel Lechner >Release: RELENG_4_7 on Intel i386 (local build) >Organization: Silicon Valley Public Access Link >Environment: FreeBSD enterprise.svpal.org 4.7-RELEASE FreeBSD 4.7-RELEASE #6: Tue Oct 15 00:05:58 PDT 2002 mikel@enterprise.thelechners.org:/usr/src/sys/compile/ENTERPRISE i386 >Description: Defining a RAID1 using older drives (eg. without LBA support) crashes the system. The problem is that the code in ata-raid.c overwrites flags in the ad driver to indicate that the drive is part of a RAID. Other flags set previously by the ad driver code (eg. AD_F_CHS_USED) are cleared by this operation. This causes a catastrophic error when the drive is later accessed to write data, resulting is a system crash and corrupted disk drives. >How-To-Repeat: Install a non-LBA disk drive, configure a RAID1 using the atacontrol command. Then create a filesystem on the RAID device ar0. Then delete the RAID configuration with the atacontrol commmand. Try to reboot. The system sometimes crashes or has problems on reboot due to corrupted boot disk. >Fix: In the function ata_raiddisk_attach, instead of overwriting the ad driver flags, OR in the AD_F_RAID_SUBDISK flag. The function ata_raiddisk_detach correctly AND out the AD_F_RAID_SUBDISK flag. Here's the diff... RCS file: /usr/ncvs/src/sys/dev/ata/ata-raid.c,v retrieving revision 1.3.2.18 diff -r1.3.2.18 ata-raid.c 104c104 < AD_SOFTC(rdp->disks[disk])->flags = AD_F_RAID_SUBDISK; --- > AD_SOFTC(rdp->disks[disk])->flags |= AD_F_RAID_SUBDISK; 343c343 < AD_SOFTC(rdp->disks[disk])->flags = AD_F_RAID_SUBDISK; --- > AD_SOFTC(rdp->disks[disk])->flags |= AD_F_RAID_SUBDISK; >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message