freebsd-dev/sys/fs/smbfs
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
..
smbfs_io.c Axe the 'thread' argument from VOP_ISLOCKED() and lockstatus() as it is 2008-02-25 18:45:57 +00:00
smbfs_node.c Replace lockmgr lock protecting smbfs node hash table with sx lock. 2008-03-02 18:56:13 +00:00
smbfs_node.h Move the head of byte-level advisory lock list from the 2008-04-16 11:33:32 +00:00
smbfs_smb.c Use pause() rather than tsleep() on stack variables and function pointers. 2007-02-27 17:23:29 +00:00
smbfs_subr.c Ditch crummy fattime <--> timespec conversion functions 2006-10-24 11:55:18 +00:00
smbfs_subr.h
smbfs_vfsops.c Replace lockmgr lock protecting smbfs node hash table with sx lock. 2008-03-02 18:56:13 +00:00
smbfs_vnops.c Move the head of byte-level advisory lock list from the 2008-04-16 11:33:32 +00:00
smbfs.h Replace lockmgr lock protecting smbfs node hash table with sx lock. 2008-03-02 18:56:13 +00:00