netbsd-bugs@netbsd.org
[Top] [All Lists]

Re: kern/39052: assertion "!ISSET(bp->b_cflags, BC_BUSY)" failed

Subject: Re: kern/39052: assertion "!ISSET(bp->b_cflags, BC_BUSY)" failed
From: Manuel Bouyer
Date: Fri, 27 Jun 2008 22:20:40 +0200
On Fri, Jun 27, 2008 at 09:17:53PM +0200, Manuel Bouyer wrote:
> > 
> > Now, is it OK to have a dirty buffer in the LRU queue ? It looks like
> > we could recycle dirty buffers from the LRU queue without flushing them
> > to disk first, isn't it ?
> 
> One case where this can happen is though bdwrite(), which sets
> BO_DELWRI before calling brelse(). I added a check for this in brelsel()
> (putting a BO_DELWRI buffer in one of the free lists), and got several
> different traces; but it always has bdwrite() in it.
> 
> Where do we go from here ?

I think I got to the roots of this bug: the KASSERT() is wrong.
It's valid to have a BC_BUSY buffer in the LRU queue, if it's also B_VFLUSH.
This case will be handler a few lines later, and the buffer is removed
from the queue but not recycled.

The attached patches fix it, adds a few more KASSERT, and fixes
checkfreelist() to work when we want to check that something is not on the
free list.

Is it OK to commit ?

-- 
Manuel Bouyer <bouyer@xxxxxxxxxxxxxxx>
     NetBSD: 26 ans d'experience feront toujours la difference
--

Attachment: d
Description: Text document

<Prev in Thread] Current Thread [Next in Thread>