freebsd-dev/sys/fs/msdosfs
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
..
bootsect.h Remove checks for BOOTSIG[23] from FAT32 bootblocks. 2005-09-29 14:09:46 +00:00
bpb.h Fix some bugs involving the fsinfo block (many remain unfixed). This is 2007-07-12 16:09:07 +00:00
denode.h Move the head of byte-level advisory lock list from the 2008-04-16 11:33:32 +00:00
direntry.h Fix races in msdosfs_lookup() and msdosfs_readdir(). These functions 2007-08-31 22:29:55 +00:00
fat.h /* -> /*- for copyright notices, minor format tweaks as necessary 2005-01-06 18:10:42 +00:00
msdosfs_conv.c Fix races in msdosfs_lookup() and msdosfs_readdir(). These functions 2007-08-31 22:29:55 +00:00
msdosfs_denode.c Cleanup lockmgr interface and exported KPI: 2008-01-24 12:34:30 +00:00
msdosfs_fat.c Remove some debugging code that, while useful, doesn't belong in the committed 2007-10-25 08:23:08 +00:00
msdosfs_fileno.c Remove unused include(s). 2007-08-07 02:08:06 +00:00
msdosfs_iconv.c Remove unused include(s). 2007-08-07 02:08:06 +00:00
msdosfs_lookup.c VOP_LOCK1() (and so VOP_LOCK()) and VOP_UNLOCK() are only used in 2008-01-13 14:44:15 +00:00
msdosfs_vfsops.c Add the support for the AT_FDCWD and fd-relative name lookups to the 2008-03-31 12:01:21 +00:00
msdosfs_vnops.c Move the head of byte-level advisory lock list from the 2008-04-16 11:33:32 +00:00
msdosfsmount.h Fix some bugs involving the fsinfo block (many remain unfixed). This is 2007-07-12 16:09:07 +00:00