Subject: Re: Use vn_rdwr in vnd (Re: kern/34882)
To: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
From: Julio M. Merino Vidal <jmmv84@gmail.com>
List: tech-kern
Date: 11/11/2006 12:40:03
On 11/11/06, YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp> wrote:
> > > > > i don't know how read requests with B_VFLUSH happens
> > > >
> > > > Just try a newfs over the vnd device and you'll get into
> > > > handle_with_rw with B_READ and B_VFLUSH set.
> > >
> > > i tried the following with the attached patch, but got no panics.
> > >
> > >                 mount_tmpfs a /mnt
> > >                 cd /mnt
> > >                 dd if=/dev/zero of=x bs=1m count=1
> > >                 vnconfig vnd0 x
> > >                 newfs -F /dev/rvnd0d
> >
> > Of course not because that's what the increment of numoutput is for
> > (or was supposed to be for).
>
> i meant i didn't get the panic in a patch attached in my previous mail.

Oh, I'm sorry.  Didn't notice it.

> >       printf("%s, %s\n", doread ? "read" : "write",
> >           obp->b_flags & B_VFLUSH ? "flush" : "noflush");
> >       if (!doread)
> >               vp->v_numoutput++;
> >
> > And it does not panic.  I'm sure it did before!  And I'm sure I got
> > "read, sync" messages from the debug printf.  (But maybe it was
> > because I still had some other problem somewhere in the handling of
> > petitions.)
>
> do you mean "read, flush" ?

Yep.

> > So... should I remove all the B_VFLUSH handling from the function?
> > Should I change the manual v_numoutput increment to use the
> > V_INCR_NUMOUTPUT macro?
>
> yes and yes.  afaik, B_VFLUSH is not something which vnd should care.

OK, will do that later today.

-- 
Julio M. Merino Vidal <jmmv84@gmail.com>
The Julipedia - http://julipedia.blogspot.com/