Subject: Re: Use vn_rdwr in vnd (Re: kern/34882)
To: None <jmmv@NetBSD.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org,>
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
List: netbsd-bugs
Date: 11/11/2006 11:40:03
The following reply was made to PR kern/34882; it has been noted by GNATS.

From: yamt@mwd.biglobe.ne.jp (YAMAMOTO Takashi)
To: jmmv84@gmail.com
Cc: tech-kern@netbsd.org, gnats-bugs@NetBSD.org
Subject: Re: Use vn_rdwr in vnd (Re: kern/34882)
Date: Sat, 11 Nov 2006 20:36:36 +0900 (JST)

 > > > > 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.
 
 > 	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" ?
 
 > 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.
 
 YAMAMOTO Takashi