Subject: Interlock issues with VOP_PUTPAGES, was Re: CVS commit: src/sys/nfs
To: None <tech-kern@netbsd.org>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 10/01/2003 12:26:58
--J/dobhs11T7y2rNN
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Aug 26, 2003 at 04:40:10PM +0000, Paul Kranenburg wrote:
>=20
> Module Name:	src
> Committed By:	pk
> Date:		Tue Aug 26 16:40:10 UTC 2003
>=20
> Modified Files:
> 	src/sys/nfs: nfs_bio.c
>=20
> Log Message:
> VOP_PUTPAGES() must be called with the vnode's interlock held.

I've been thinking about this, and I think it's really not right.
Not that pk changed nfs, but that VOP_PUTPAGES() needs this interlock
held.

I've got some concerns with this:

1) It's not documented. The only locking mentioned for VOP_PUTPAGES()
is that the vnode lock doesn't change state. The requirement for grabbing
the interlock isn't mentioned.

It doesn't mesh well with the rest of the vnode system design.

2) AFAIK it is the only place where we have to hold an interlock
before calling a VOP call (getpages may also count, I don't know).

3) It doesn't work at all with our layered file systems. Yes, Chuck
added code in layer_putpages() to shuffle around the interlocks,
but it's still not right. The interlock that the upper code grabbed
isn't the one the putpages code deals with. Which makes me kinda
wonder what's going on. :-)

A lot of places I've seen just grab the interlock just before the call.

So what is up with this interlock? Is there some other way we can
address this problem?

Take care,

Bill

--J/dobhs11T7y2rNN
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)

iD8DBQE/eyqCWz+3JHUci9cRAoJJAJ9e3aIs+Q2co1U8Ajl+B81AzWwI1wCffEHb
fWtMxzsJGJTYZw/+eJ854Ao=
=CmC0
-----END PGP SIGNATURE-----

--J/dobhs11T7y2rNN--