From 52243403eb48561abd7b33995f5a4be6a56fa1f0 Mon Sep 17 00:00:00 2001 From: kib Date: Wed, 16 Apr 2008 11:33:32 +0000 Subject: 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 --- sys/fs/msdosfs/denode.h | 1 - 1 file changed, 1 deletion(-) (limited to 'sys/fs/msdosfs/denode.h') diff --git a/sys/fs/msdosfs/denode.h b/sys/fs/msdosfs/denode.h index fbd95aa..4e03e9a 100644 --- a/sys/fs/msdosfs/denode.h +++ b/sys/fs/msdosfs/denode.h @@ -159,7 +159,6 @@ struct denode { u_long de_FileSize; /* size of file in bytes */ struct fatcache de_fc[FC_SIZE]; /* fat cache */ u_quad_t de_modrev; /* Revision level for lease. */ - struct lockf *de_lockf; /* lockf */ u_int64_t de_inode; /* Inode number (really byte offset of direntry) */ }; -- cgit v1.1