freebsd-nq/sys/fs
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
..
cd9660 This update changes the mnt_flag field in the mount structure from 2011-07-24 17:43:09 +00:00
coda Second-to-last commit implementing Capsicum capabilities in the FreeBSD 2011-08-11 12:30:23 +00:00
deadfs Add function vop_rename_fail(9) that performs needed cleanup for locks 2010-04-02 14:03:01 +00:00
devfs Existing VOP_VPTOCNP() interface has a fatal flow that is critical for 2011-11-19 07:50:49 +00:00
ext2fs Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs. 2011-11-07 15:43:11 +00:00
fdescfs Second-to-last commit implementing Capsicum capabilities in the FreeBSD 2011-08-11 12:30:23 +00:00
fifofs Add the fo_chown and fo_chmod methods to struct fileops and use them 2011-08-16 20:07:47 +00:00
hpfs Add a lock flags argument to the VFS_FHTOVP() file system 2011-05-22 01:07:54 +00:00
msdosfs Add unicode support to msdosfs and smbfs; original pathes from imura, 2011-11-18 03:05:20 +00:00
nfs Revert revision 224079 as Rick pointed out that I would be calling VOP_PATHCONF 2011-07-17 03:44:05 +00:00
nfsclient Modify the new NFS client so that nfs_fsync() only calls ncl_flush() 2011-11-15 23:35:43 +00:00
nfsserver In order to maximize the re-usability of kernel code in user space this 2011-09-16 13:58:51 +00:00
ntfs Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs. 2011-11-07 06:44:47 +00:00
nullfs Existing VOP_VPTOCNP() interface has a fatal flow that is critical for 2011-11-19 07:50:49 +00:00
nwfs Remove MALLOC_DECLAREs of nonexisting malloc-pools. 2011-11-06 20:16:50 +00:00
portalfs Trace attempts to open a portal device. 2011-10-18 07:31:49 +00:00
procfs Lock the thread lock around block that retrieves td_wmesg. Otherwise, 2011-11-09 17:15:51 +00:00
pseudofs Existing VOP_VPTOCNP() interface has a fatal flow that is critical for 2011-11-19 07:50:49 +00:00
smbfs Add unicode support to msdosfs and smbfs; original pathes from imura, 2011-11-18 03:05:20 +00:00
tmpfs Don astbestos garment and remove the warning about TMPFS being experimental 2011-11-07 16:21:50 +00:00
udf Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs. 2011-11-07 06:44:47 +00:00
unionfs Make unionfs also clear VAPPEND when clearing VWRITE, since VAPPEND 2011-10-10 21:32:08 +00:00