From nobody@FreeBSD.org  Sun Jul 31 07:17:53 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0FA7A106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 31 Jul 2011 07:17:53 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 015B38FC19
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 31 Jul 2011 07:17:52 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p6V7HqvC062380
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 31 Jul 2011 07:17:52 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p6V7Hqib062379;
	Sun, 31 Jul 2011 07:17:52 GMT
	(envelope-from nobody)
Message-Id: <201107310717.p6V7Hqib062379@red.freebsd.org>
Date: Sun, 31 Jul 2011 07:17:52 GMT
From: Masanao Goto <gmasanao@nifty.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: kernel panics when accessing spindowned HDDs
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         159326
>Category:       kern
>Synopsis:       [ata] [panic] kernel panics when accessing spindowned HDDs
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jul 31 07:20:02 UTC 2011
>Closed-Date:    
>Last-Modified:  Mon Aug 01 00:32:17 UTC 2011
>Originator:     Masanao Goto
>Release:        FreeBSD 9-CURRENT
>Organization:
>Environment:
FreeBSD copper.smectic.com 9.0-BETA1 FreeBSD 9.0-BETA1 #2: Sat Jul 30 15:10:28 JST 2011     root@copper.smectic.com:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
When you access SATA HDDs, which has been spindowned by '/sbin/camcontrol stop /dev/da0', the kernel panics showing the message below.  
>How-To-Repeat:
1. spindown all the HDDs using camcontrol command
/sbin/camcontrol stop /dev/da0
/sbin/camcontrol stop /dev/da1
/sbin/camcontrol stop /dev/da2
/sbin/camcontrol stop /dev/da3
/sbin/camcontrol stop /dev/da4
/sbin/camcontrol stop /dev/da5

2. write substantial amount of file to raidz pool
dd if=/dev/null of=/raidz_pool_name/test_file_name count=20 bs=1g
To surely cause a kernel-panic, you have to write data more than memory capacity, in my case 16GB.  

3. kernel always panics
 >>
 panic: Bad link elm oxfffffe0008c77800 prev->next != elm
 cpuid = 1
 KDB: enter: panic
 [ thread pid 12 tid 100021 ]
 Stopped at       kdb_enter+0x3b: movq     $0, 0x912652(%rip)
 db>
 <<
 
 the machine setup is as follows
 [cpu]  Pentium G620
 [M/B]  H67MA-E45 v1.8 (FreeBSD can not boot up with SMP on v1.7 BIOS)
 [HDD]       SHD-NSUM60G, WD30EZRS*3,WD30EZRX*3
 [memory]  DDR3 1333 2GB*4
 [SATA interface] LSI SAS 9211-8i
 
 All SATA HDDs are connected through 9211-9i HBA, then assembled into a single raidz pool.  
 SATA HDDs are identified as /dev/da[0-5]
>Fix:
Sorry I don't know.  
At least, when HDDs were connected to usual SATA buses on M/B, I didn't encountered such problem.  


>Release-Note:
>Audit-Trail:
>Unformatted:
