freebsd-nq/sys/nfsclient
Konstantin Belousov eab626f110 Move the head of byte-level advisory lock list from the
filesystem-specific vnode data to the struct vnode. Provide the
default implementation for the vop_advlock and vop_advlockasync.
Purge the locks on the vnode reclaim by using the lf_purgelocks().
The default implementation is augmented for the nfs and smbfs.
In the nfs_advlock, push the Giant inside the nfs_dolock.

Before the change, the vop_advlock and vop_advlockasync have taken the
unlocked vnode and dereferenced the fs-private inode data, racing with
with the vnode reclamation due to forced unmount. Now, the vop_getattr
under the shared vnode lock is used to obtain the inode size, and
later, in the lf_advlockasync, after locking the vnode interlock, the
VI_DOOMED flag is checked to prevent an operation on the doomed vnode.

The implementation of the lf_purgelocks() is submitted by dfr.

Reported by:	kris
Tested by:	kris, pho
Discussed with:	jeff, dfr
MFC after:	2 weeks
2008-04-16 11:33:32 +00:00
..
bootp_subr.c Remove the now-unused NET_{LOCK,UNLOCK,ASSERT}_GIANT() macros, which 2007-08-06 14:26:03 +00:00
krpc_subr.c Replaced the misleading uses of a historical artefact M_TRYWAIT with M_WAIT. 2008-03-25 09:39:02 +00:00
krpc.h
nfs_bio.c namei() can call underlying nfs_readlink() passing a struct uio pointer 2008-02-09 20:13:19 +00:00
nfs_diskless.c In keeping with style(9)'s recommendations on macros, use a ';' 2008-03-16 10:58:09 +00:00
nfs_lock.c Move the head of byte-level advisory lock list from the 2008-04-16 11:33:32 +00:00
nfs_lock.h
nfs_nfsiod.c Rename the kthread_xxx (e.g. kthread_create()) calls 2007-10-20 23:23:23 +00:00
nfs_node.c Introduce some functions in the vnode locks namespace and in the ffs 2008-02-24 16:38:58 +00:00
nfs_socket.c Replaced the misleading uses of a historical artefact M_TRYWAIT with M_WAIT. 2008-03-25 09:39:02 +00:00
nfs_subs.c Replaced the misleading uses of a historical artefact M_TRYWAIT with M_WAIT. 2008-03-25 09:39:02 +00:00
nfs_vfsops.c - Complete part of the unfinished bufobj work by consistently using 2008-03-22 09:15:16 +00:00
nfs_vnops.c Move the head of byte-level advisory lock list from the 2008-04-16 11:33:32 +00:00
nfs.h NFS MP scaling changes. 2007-10-12 19:12:21 +00:00
nfsargs.h Fix a serious deadlock with the NFS client. Given a large enough 2005-06-10 23:50:41 +00:00
nfsdiskless.h consolidate parsing of nfs root mount options in one place 2006-12-06 02:15:25 +00:00
nfsm_subs.h Consolidate the code to generate a new XID for a NFS request into a 2008-02-13 00:04:58 +00:00
nfsmount.h NFS MP scaling changes. 2007-10-12 19:12:21 +00:00
nfsnode.h Move the head of byte-level advisory lock list from the 2008-04-16 11:33:32 +00:00
nfsstats.h
nlminfo.h - Fix leak of struct nlminfo on process exit. 2005-10-26 07:18:37 +00:00