freebsd-nq/sys/fs/devfs
Konstantin Belousov f82360acf2 Existing VOP_VPTOCNP() interface has a fatal flow that is critical for
nullfs.  The problem is that resulting vnode is only required to be
held on return from the successfull call to vop, instead of being
referenced.

Nullfs VOP_INACTIVE() method reclaims the vnode, which in combination
with the VOP_VPTOCNP() interface means that the directory vnode
returned from VOP_VPTOCNP() is reclaimed in advance, causing
vn_fullpath() to error with EBADF or like.

Change the interface for VOP_VPTOCNP(), now the dvp must be
referenced. Convert all in-tree implementations of VOP_VPTOCNP(),
which is trivial, because vhold(9) and vref(9) are similar in the
locking prerequisites. Out-of-tree fs implementation of VOP_VPTOCNP(),
if any, should have no trouble with the fix.

Tested by:	pho
Reviewed by:	mckusick
MFC after:	3 weeks (subject of re approval)
2011-11-19 07:50:49 +00:00
..
devfs_devs.c Export devfs inode number allocator for the kernel consumers. 2011-10-05 16:50:15 +00:00
devfs_dir.c Add reference counting for devfs paths containing user created symbolic 2010-09-27 17:47:09 +00:00
devfs_int.h Format prototypes to follow style(9) more closely. 2010-10-12 15:58:52 +00:00
devfs_rule.c - fix duplicate "a a" in some comments 2011-11-13 17:06:33 +00:00
devfs_vfsops.c Enable shared lookups and externed shared ops for devfs. 2010-08-06 09:46:53 +00:00
devfs_vnops.c Existing VOP_VPTOCNP() interface has a fatal flow that is critical for 2011-11-19 07:50:49 +00:00
devfs.h Format prototypes to follow style(9) more closely. 2010-10-12 15:58:52 +00:00