Subject: Re: cgd->vnd panic in BETA_2.0
To: None <>
From: Karl Janmar <>
List: tech-kern
Date: 09/19/2004 22:23:19

As I mentioned this is not the only panic,

it's fairly easy to generate panics with only a vnd device, like

vnconfig /dev/vnd0 /a_file
newfs /dev/vnd0a
mount /dev/vnd0a /mnt/tmpdisk
cp -Rp /a_dir_with_lots_of_files /mnt/tmpdisk

this will sooner or later(on my system) generate a panic if I have a
pretty big filesystem on vnd0a this will allways generate a panic.

I can not generate a kernel dump for this unfortunatly, probably because
the nature of the panic but a have wrote a backtrace by hand when I where
threw into ddb on panic.

This is still on my system with an custom kernel, but I give you the
traceback corresponding to a sourceline of files from source date'd 18
(linenumber extracted with: objdump -l --prefix-addresses -S netbsd.gdb)

the backtrace is following:

*** vndstrategy()
c02e5a7d <vndstrategy+0x37d> mov    %edx,0xc(%ebx)
*** spec_strategy()
*** ufs_strategy()
*** genfs_gop_write()

(okey it takes a lot of time to extract linenumber, maybe the above
is the most interesting).




On Sun, 19 Sep 2004, Jason Thorpe wrote:

> Date: Sun, 19 Sep 2004 12:01:34 -0700
> From: Jason Thorpe <>
> To: Roland C. Dowdeswell <>
> Cc: Karl Janmar <>,
> Subject: Re: cgd->vnd panic in BETA_2.0
> On Sep 19, 2004, at 11:47 AM, Roland C. Dowdeswell wrote:
> > Well, I haven't seen the problem, but then I have not [recently]
> > run cgd(4) on vnd(4).  But, from the trace I can guess what is
> > going on here.  Basically, when cgdiodone() is called it checks to
> > see if there are any pending transactions that need to be completed
> > and if there are it will start them.  When the cgd(4) is configured
> > on a vnd(4), this jumps into file system code which expects to be
> > run from a process context not an interrupt context.
> >
> > I'll have to think a bit about how to solve this one.
> In general, we probably need to make sure that all disk drivers'
> "strategy" routines are safe for calling from interrupt context.
> For vnd, this probably means having a kernel thread waiting around to
> do the actual processing.
>          -- Jason R. Thorpe <>