From dima@burka.rdy.com  Sun Mar 22 18:07:55 1998
Received: from burka.rdy.com (dima@burka.rdy.com [205.149.163.30])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA21278
          for <FreeBSD-gnats-submit@freebsd.org>; Sun, 22 Mar 1998 18:07:54 -0800 (PST)
          (envelope-from dima@burka.rdy.com)
Received: by burka.rdy.com id SAA18979;
  (8.8.8/RDY) Sun, 22 Mar 1998 18:07:54 -0800 (PST)
Message-Id: <199803230207.SAA18979@burka.rdy.com>
Date: Sun, 22 Mar 1998 18:07:54 -0800 (PST)
From: dima@best.net
Reply-To: dima@best.net
To: FreeBSD-gnats-submit@freebsd.org
Subject: panic: biodone: buffer not busy
X-Send-Pr-Version: 3.2

>Number:         6102
>Category:       kern
>Synopsis:       panic: biodone: buffer not busy
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Mar 22 18:10:01 PST 1998
>Closed-Date:    Wed Sep 30 23:28:25 PDT 1998
>Last-Modified:  Wed Sep 30 23:30:15 PDT 1998
>Originator:     Dima Ruban
>Release:        FreeBSD 2.2.6-BETA i386
>Organization:
Best Internet Communiactions, Inc.
>Environment:

	FreeBSD tick.best.net 2.2.6-BETA FreeBSD 2.2.6-BETA #32: Tue Mar 17
13:08:39 PST 1998     dima@tick.best.net:/src/src/sys/compile/BEST  i386


>Description:

	Once in a while kernel panics with following messages:

	biodone: buffer already done
	biodone: buffer already done
	panic: biodone: buffer not busy

>How-To-Repeat:

	I don't know, how to repeat this problem.
	Here's trace from kdb:

	biodone: buffer already done
	biodone: buffer already done
	panic: biodone: buffer not busy
	Debugger("panic")
	Stopped at      _Debugger+0x35 [/sys/compile/BEST/:52]: movb
	$0,_in_Debugger.
	1
	22
	db> 
	db> trace
	_Debugger(msg=f0113238) at _Debugger+0x35 [/sys/compile/BEST/:52]
	_panic(fmt=f012e8a9) at _panic+0x5a [/sys/compile/BEST/:388]
	_biodone(bp=f45ce3e8) at _biodone+0x30
	[/usr/src/sys/compile/BEST/:1561]
	_scsi_done(xs=f2629f00) at _scsi_done+0x84 [/sys/compile/BEST/:450]
	_ahc_intr(arg=f24c4800) at _ahc_intr+0x1c7 [/sys/compile/BEST/:815]
	Xresume10() at Xresume10+0x2b
	--- interrupt, eip = 0xf01be075, esp = 0xf01dcff8, ebp = 0 ---
	idle_loop() at idle_loop+0x3d
	db> 

	We couldn't get a memory dump from it though:

	db> panic
	panic: from debugger

	dumping to dev 401, offset 524288
	dump ahc0: WARNING no command for scb 3 (cmdcmplt)
	QOUTCNT == 5
	biodone: buffer already done
	panic: biodone: buffer not busy

	dumping to dev 401, offset 524288
	dump device not ready
	Automatic reboot in 15 seconds - press a key on the console to abort
	Rebooting...

>Fix:
	
	Unknown (yet).

>Release-Note:
>Audit-Trail:

From: David Greenman <dg@root.com>
To: dima@best.net
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: kern/6102: panic: biodone: buffer not busy 
Date: Sun, 22 Mar 1998 20:55:51 -0800

 >>Synopsis:       panic: biodone: buffer not busy
 
    ...believed to be fixed in the Justin's CAM implementation. I have not
 seen this problem since switching to CAM on wcarchive.
 
 -DG
 
 David Greenman
 Core-team/Principal Architect, The FreeBSD Project

From: Dima Ruban <dima@rdy.com>
To: freebsd-gnats-submit@freebsd.org, dima@best.net
Cc:  Subject: Re: kern/6102: panic: biodone: buffer not busy
Date: Mon, 23 Mar 1998 01:45:17 -0800

 According to Jordan, there are no CAM diffs for -stable.
 
 -- dima

From: Cy Schubert <cschuber@uumail.gov.bc.ca>
To: freebsd-gnats-submit@freebsd.org, dima@best.net
Cc:  Subject: Re: kern/6102: panic: biodone: buffer not busy
Date: Tue, 05 May 1998 22:39:47 -0700

 The CVS log for vfs_bio.c states,
 
 1.67 Thu Oct 19 23:48:25 1995 UTC by dyson 
 Diffs to 1.66 
 
 If we clear the B_CACHE flag because a buffer isn't composed fully of
 valid bytes, we must also clear the B_DONE flag.  Some filesystems
 depend on this (incl NFS) and is probably the cause of the biodone
 error and subsequent crash.  Anyway this change needs to be made.
 
 The question I have is, why must the B_DONE flag be cleared when the
 B_CACHE flag is cleared?
 
 I've had this problem since 2.2.5.  Since 2.2.6, the problem appears to
 have gotten worse, e.g. two panics in the last 5 minutes.  In both cases
 a "find . | cpio -pdm /vol/archives" to copy data to a SCSI Zip disk was
 running at the time of panic.
 
 Cy Schubert
State-Changed-From-To: open->closed 
State-Changed-By: jkoshy 
State-Changed-When: Wed Sep 30 23:28:25 PDT 1998 
State-Changed-Why:  
Requested by originator: 

dima> ...  The problem turned out to be a broken FIFO on 2940, and all I  
dima>  did to fix it - I just reduced the number of SCBs from 16 to 12. 

>Unformatted:
