Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: vfs_bio KASSERT (again)



On Mon, Jun 23, 2008 at 11:31:14AM +0200, Manuel Bouyer wrote:
> [...]
> That was not it, I got the panic again:
> panic: kernel diagnostic assertion "!ISSET(bp->b_cflags, BC_BUSY)" failed: 
> file6
> fatal breakpoint trap in supervisor mode
> trap type 1 code 0 rip ffffffff804abc6d cs e030 rflags 246 cr2  7f7ffd816060 
> cp0
> Stopped in pid 1009.1 (find) at netbsd:breakpoint+0x5:  leave
> breakpoint() at netbsd:breakpoint+0x5
> panic() at netbsd:panic+0x255
> __kernassert() at netbsd:__kernassert+0x2d
> getnewbuf() at netbsd:getnewbuf+0x2b4
> getblk() at netbsd:getblk+0x91
> bio_doread() at netbsd:bio_doread+0x24
> bread() at netbsd:bread+0x22
> ffs_read() at netbsd:ffs_read+0x372
> VOP_READ() at netbsd:VOP_READ+0x2d
> ufs_readdir() at netbsd:ufs_readdir+0x10b
> VOP_READDIR() at netbsd:VOP_READDIR+0x39
> vn_readdir() at netbsd:vn_readdir+0x10e
> sys___getdents30() at netbsd:sys___getdents30+0x89
> syscall() at netbsd:syscall+0x98
> 
> Are we supposed to clear BC_BUSY ourselve too ?

I've built a kernel with the attached patch, and got this panic:
panic: kernel diagnostic assertion "!ISSET(bp->b_cflags, BC_BUSY)" failed: file 
"/dsk/l1/misc/bouyer/current/src/sys/kern/vfs_bio.c", line 1047
fatal breakpoint trap in supervisor mode
trap type 1 code 0 rip ffffffff804abd0d cs e030 rflags 246 cr2  0 cpl 0 rsp 
ffffffff80d838b0
Stopped in pid 0.1 (system) at  netbsd:breakpoint+0x5:  leave
breakpoint() at netbsd:breakpoint+0x5
panic() at netbsd:panic+0x255
__kernassert() at netbsd:__kernassert+0x2d
brelsel() at netbsd:brelsel+0x5c6
brelse() at netbsd:brelse+0x2c
readdisklabel() at netbsd:readdisklabel+0x1b0
wdgetdisklabel() at netbsd:wdgetdisklabel+0x98
wdopen() at netbsd:wdopen+0x165
spec_open() at netbsd:spec_open+0x29a
VOP_OPEN() at netbsd:VOP_OPEN+0x29
rf_find_raid_components() at netbsd:rf_find_raid_components+0x15c
rf_autoconfig() at netbsd:rf_autoconfig+0x2f
config_finalize() at netbsd:config_finalize+0x87
main() at netbsd:main+0x232

We're about to put a BC_BUSY buffer on the BQ_AGE.
what is supposed to clear BC_BUSY ?

-- 
Manuel Bouyer, LIP6, Universite Paris VI.           
Manuel.Bouyer%lip6.fr@localhost
     NetBSD: 26 ans d'experience feront toujours la difference
--
Index: vfs_bio.c
===================================================================
RCS file: /cvsroot/src/sys/kern/vfs_bio.c,v
retrieving revision 1.205
diff -u -r1.205 vfs_bio.c
--- vfs_bio.c   17 Jun 2008 19:14:14 -0000      1.205
+++ vfs_bio.c   23 Jun 2008 10:01:57 -0000
@@ -1044,6 +1044,7 @@
                else
                        /* invalid data */
                        bufq = &bufqueues[BQ_AGE];
+               KASSERT(!ISSET(bp->b_cflags, BC_BUSY));
                binsheadfree(bp, bufq);
        } else  {
                /*
@@ -1060,6 +1061,7 @@
                } else if (!ISSET(bp->b_cflags, BC_AGE)) {
                        /* valid data */
                        bufq = &bufqueues[BQ_LRU];
+                       KASSERT(!ISSET(bp->b_cflags, BC_BUSY));
                } else {
                        /* stale but valid data */
                        int has_deps;
@@ -1070,6 +1072,7 @@
                                has_deps = 0;
                        bufq = has_deps ? &bufqueues[BQ_LRU] :
                            &bufqueues[BQ_AGE];
+                       KASSERT(!ISSET(bp->b_cflags, BC_BUSY));
                }
                binstailfree(bp, bufq);
        }


Home | Main Index | Thread Index | Old Index