From pete@rms21.rommon.net  Sat Oct 18 14:03:59 2003
Return-Path: <pete@rms21.rommon.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 2568516A4B3
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 18 Oct 2003 14:03:59 -0700 (PDT)
Received: from rms21.rommon.net (rms21.rommon.net [193.64.42.200])
	by mx1.FreeBSD.org (Postfix) with ESMTP id EBCD143F75
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 18 Oct 2003 14:03:57 -0700 (PDT)
	(envelope-from pete@rms21.rommon.net)
Received: from rms21.rommon.net (localhost [127.0.0.1])
	by rms21.rommon.net (8.12.10/8.12.9) with ESMTP id h9IL3uuX087143
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 19 Oct 2003 00:03:56 +0300 (EEST)
	(envelope-from pete@rms21.rommon.net)
Received: (from pete@localhost)
	by rms21.rommon.net (8.12.10/8.12.10/Submit) id h9IL3tLP087142;
	Sun, 19 Oct 2003 00:03:55 +0300 (EEST)
	(envelope-from pete)
Message-Id: <200310182103.h9IL3tLP087142@rms21.rommon.net>
Date: Sun, 19 Oct 2003 00:03:55 +0300 (EEST)
From: Petri Helenius <pete@helenius.fi>
Reply-To: Petri Helenius <pete@helenius.fi>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: ata raid crashes in g_down
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         58230
>Category:       kern
>Synopsis:       ata raid crashes in g_down
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    sos
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Oct 18 14:10:13 PDT 2003
>Closed-Date:    Mon Jan 12 11:23:15 PST 2004
>Last-Modified:  Mon Jan 12 11:23:15 PST 2004
>Originator:     Petri Helenius
>Release:        FreeBSD 5.1-CURRENT i386
>Organization:
>Environment:
System: FreeBSD  5.1-CURRENT FreeBSD 5.1-CURRENT #16: Sun Oct 12 19:41:04 GMT 2003     root@kompak.vuokselantie10.fi:/usr/src/sys/i386/compile/EMTEST  i386

	
>Description:
	When running the system with degraded ataraid set, it crashes in 
	make world
0xc0463d79 is in arstrategy (../../../dev/ata/ata-raid.c:832).
827                             buf1->drive = buf1->drive + rdp->width;
828                     }
829                 }
830                 buf1->bp.bio_disk = &AD_SOFTC(rdp->disks[buf1->drive])->disk;
831                 AR_STRATEGY((struct bio *)buf1);
832                 rdp->disks[buf1->drive].last_lba = buf1->bp.bio_pblkno + chunk;
833                 break;
834
835             default:
836                 printf("ar%d: unknown array type in arstrategy\n", rdp->lun);
(gdb) 
Suspended

Fatal trap 12: page fault while in kernel mode
fault virtual address   = 0xa2e664f4
fault code              = supervisor write, page not present
instruction pointer     = 0x8:0xc0463d79
stack pointer           = 0x10:0xcdaaebc4
frame pointer           = 0x10:0xcdaaec54
code segment            = base 0x0, limit 0xfffff, type 0x1b
                        = DPL 0, pres 1, def32 1, gran 1
processor eflags        = interrupt enabled, resume, IOPL = 0
current process         = 4 (g_down)
kernel: type 12 trap, code=0
Stopped at      arstrategy+0x939:       movl    %eax,0x24(%ebx,%ecx,8)
db> trace
arstrategy(c2bbb090,0,c06ae5c7,5c,0) at arstrategy+0x939
g_disk_start(c2b885a0,0,c06aeb6b,164,a) at g_disk_start+0x1a6
g_io_schedule_down(c12a2000,2,c06aed89,6e,c04e5f40) at g_io_schedule_down+0x1ac
g_down_procbody(0,cdaaed48,c06b0b1a,314,20aa) at g_down_procbody+0x48
fork_exit(c04e5f40,0,cdaaed48) at fork_exit+0xcf
fork_trampoline() at fork_trampoline+0x8
--- trap 0x1, eip = 0, esp = 0xcdaaed7c, ebp = 0 ---
db> 

>How-To-Repeat:
	
>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->sos 
Responsible-Changed-By: simon 
Responsible-Changed-When: Sun Oct 19 06:09:15 PDT 2003 
Responsible-Changed-Why:  
Over to ata(4) maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=58230 
State-Changed-From-To: open->suspended 
State-Changed-By: sos 
State-Changed-When: Sat Oct 25 12:32:32 PDT 2003 
State-Changed-Why:  
The problem is known and will get fixed when ata-raid gets updated 
to take advantage of ATAng's features (WIP). 
GNATSo Enter the reason for changing this PR's state here. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=58230 

From: Claus Endres <claus@endresconsulting.com>
To: freebsd-gnats-submit@FreeBSD.org, pete@helenius.fi
Cc:  
Subject: Re: kern/58230: ata raid crashes in g_down
Date: Sun, 23 Nov 2003 21:34:53 +1100

 This is a multi-part message in MIME format.
 --------------070207080704010207060708
 Content-Type: text/plain; charset=us-ascii; format=flowed
 Content-Transfer-Encoding: 7bit
 
 Hi,
 
 The attached patch against 5.1-RELEASE fixes the problem.
 
 If the primary fails, and a read is attempted in the vicinity
 of the last position on the primary, or within the first
 AR_PROXIMITY (2048) blocks on the drive if the primary was
 never active, a TOGGLE is prformed to the primary drive.
 
 Solution is to ignore the last primary position if the
 drive is not ONLINE.
 
 Regards,
 Claus.
 -- 
 --------------------------------------------------------
 Claus Endres                | Phone:  +61-3-5998 2310
 Endres Consulting Pty. Ltd. | Mobile: +61-418-595 136
 10 Facey Road               | Fax:    +61-3-5998 2540
 Devon Meadows, VIC 3977     | claus@endresconsulting.com
 
 --------------070207080704010207060708
 Content-Type: text/plain;
  name="ata-raid.c.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline;
  filename="ata-raid.c.diff"
 
 --- dev/ata/ata-raid.c.orig	Fri May  9 02:38:14 2003
 +++ dev/ata/ata-raid.c	Sun Nov 23 21:18:14 2003
 @@ -766,7 +766,8 @@
  	    if (bp->bio_cmd == BIO_READ) {
  		/* if mirror gone or close to last access on source */
  		if (!(rdp->disks[buf1->drive+rdp->width].flags & AR_DF_ONLINE)||
 -		    (buf1->bp.bio_pblkno >=
 +		    ((rdp->disks[buf1->drive].flags & AR_DF_ONLINE) &&
 +		     buf1->bp.bio_pblkno >=
  		     (rdp->disks[buf1->drive].last_lba - AR_PROXIMITY) &&
  		     buf1->bp.bio_pblkno <=
  		     (rdp->disks[buf1->drive].last_lba + AR_PROXIMITY))) {
 
 --------------070207080704010207060708--
 
State-Changed-From-To: suspended->closed 
State-Changed-By: sos 
State-Changed-When: Mon Jan 12 11:22:47 PST 2004 
State-Changed-Why:  
Fixed in -current. 

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