From nobody@FreeBSD.org  Mon Oct 28 16:16:10 2002
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 1C09F37B404
	for <freebsd-gnats-submit@FreeBSD.org>; 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 <freebsd-gnats-submit@FreeBSD.org>; 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 <freebsd-gnats-submit@FreeBSD.org>; 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 <mikel@svpal.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: ar RAID driver crashes using older DISKS
X-Send-Pr-Version: www-1.0

>Number:         44581
>Category:       i386
>Synopsis:       ar RAID driver crashes using older DISKS
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 28 16:20:00 PST 2002
>Closed-Date:    Mon May 05 05:45:54 PDT 2003
>Last-Modified:  Mon May 05 05:45:54 PDT 2003
>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:
State-Changed-From-To: open->closed 
State-Changed-By: sos 
State-Changed-When: Mon May 5 05:45:39 PDT 2003 
State-Changed-Why:  
Fixed in -current (5.1) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=44581 
>Unformatted:
