Subject: assertion "(vp->v_flag & VONWORKLST)" failed on VOP_PUTPAGES
To: None <tech-kern@netbsd.org>
From: Tomas Olsson <tol@stacken.kth.se>
List: tech-kern
Date: 04/07/2006 14:34:55
Hi,
I'm running Arla[1] in my xen host (DEBUG, DIAGNOSTIC). Occasionally I get 
  panic: kernel debugging assertion "(vp->v_flag & VONWORKLST)" failed: file "/home/builds/ab/netbsd-3-0-RELEASE/src/sys/miscfs/genfs/genfs_vnops.c", line 1322
while doing VOP_PUTPAGES() against my vnode during VOP_CLOSE(). I could of
course just avoid doing PUTPAGES if the flag isn't set, but exactly what is
the proper way to do this? Invariants? What I'm really trying to do is to
synchronously write any changes to a cache file on local disk, before
informing our daemon about the close.

thanks
        /t

1. http://www.stacken.kth.se/project/arla/


Details (emul_freebsd_object really is my module nnpfs, I guess):

db> trace
cpu_Debugger(c03d3880,c083d90c,5996463,c065a240,1) at
netbsd:cpu_Debugger+0x4
panic(c03c8860,c038f2eb,c0396cd4,c03bc6a0,52a) at netbsd:panic+0x121
__main(c038f2eb,c03bc6a0,52a,c0396cd4,0) at netbsd:__main
genfs_putpages(ca503db4,0,44350d65,27479290,c037f540) at
netbsd:genfs_putpages+0x86a
VOP_PUTPAGES(cabcb9e8,0,0,0,0) at netbsd:VOP_PUTPAGES+0x40
emul_freebsd_object(cabcb9e8,0,0,20002,cabcb9e8) at 0xca888f22
emul_freebsd_object(cabcb9e8,a,cab42998,c9be0150,c0902200) at 0xca8860e6
emul_freebsd_object(ca503e74,6,0,44350d65,c037ea80) at 0xca887e40
VOP_CLOSE(cabcb9e8,a,c9be0150,cab42998,cabcb9e8) at netbsd:VOP_CLOSE+0x34
vn_close(cabcb9e8,a,c9be0150,cab42998,804b000) at netbsd:vn_close+0x2e
vn_closefile(c9bf4e38,cab42998,ca503f3c,c02a0dbf,cab42998) at
netbsd:vn_closefile+0x1a
closef(c9bf4e38,cab42998,ca503f5c,0,c03347e9) at netbsd:closef+0x10f
syscall_plain() at netbsd:syscall_plain+0x18f
--- syscall (number 6) ---
0xbdb471b7:
db> show vnode /f cabcb9e8
OBJECT 0xcabcb9e8: locked=0, pgops=0xc03d3430, npages=1, refs=1
  PAGES <pg,offset>:
  <0xc065a240,0x0> <0xca503d04,0xffffffffffffffff>

VNODE flags 0
mp 0xc0a3a000 numoutput 0 size 0x1c7
data 0xc0902200 usecount 1 writecount 0 holdcnt 1 numoutput 0
tag VT_AFS(13) type VREG(1) mount 0xc0a3a000 typedata 0x0
clean bufs:
dirty bufs:
db>