1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-02 08:42:48 +00:00
freebsd/sys
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
..
amd64 This file is unused on amd64. 2008-04-15 02:10:14 +00:00
arm - Add the interrupt vector number to intr_event_create so MI code can 2008-04-11 03:26:41 +00:00
boot Revert the previous change and let PROBE_KEYBOARD function identical to -P 2008-04-09 17:59:17 +00:00
bsm Merge OpenBSM 1.0 changes to src/sys/bsm: 2007-10-29 18:47:25 +00:00
cam Locking in the ses_ioctl handler doesn't have to be so strict because 2008-03-17 17:18:16 +00:00
cddl Move the head of byte-level advisory lock list from the 2008-04-16 11:33:32 +00:00
compat Remove using magic value of -1 to distinguish between linux_open() 2008-04-09 16:42:50 +00:00
conf Convert amd64 and i386 to share the atrtc device driver. 2008-04-14 08:00:00 +00:00
contrib Make ALTQ cope with disappearing interfaces (particularly common with mpd 2008-03-29 00:24:36 +00:00
crypto Make test00 compilable again. 2008-01-15 18:34:47 +00:00
ddb enable dynamic addition of "show all" commands 2008-03-25 20:36:32 +00:00
dev style(9). 2008-04-15 22:47:01 +00:00
fs Move the head of byte-level advisory lock list from the 2008-04-16 11:33:32 +00:00
gdb Commit SYSINIT() ;-adding patch missed in previous pass. 2008-03-16 13:02:04 +00:00
geom Add the bootcode verb for installing boot code. Boot code 2008-04-13 19:54:54 +00:00
gnu Move the head of byte-level advisory lock list from the 2008-04-16 11:33:32 +00:00
i4b Spelling fix for interupt -> interrupt 2007-10-12 06:03:46 +00:00
i386 Convert amd64 and i386 to share the atrtc device driver. 2008-04-14 08:00:00 +00:00
ia64 Use genclock for RTC handling. This eliminates the MD versions for 2008-04-15 17:02:23 +00:00
isa atrtc.c is a repocopy of the RTC device driver from i386/isa/clock.c 2008-04-14 07:57:15 +00:00
kern Move the head of byte-level advisory lock list from the 2008-04-16 11:33:32 +00:00
libkern Add prototype for __cmpd2(). 2008-02-23 22:40:05 +00:00
mips This file shows signs of heavy borrowing from NetBSD's cache.c file, 2008-04-15 05:35:00 +00:00
modules Connect k8temp(4) to the build. 2008-04-12 14:20:22 +00:00
net Revert the previous commit and use M_PROMISC flag instead. 2008-04-15 17:08:24 +00:00
net80211 Fix adhoc mode to scan all available channels for a bss to join 2008-02-29 04:07:07 +00:00
netatalk Replaced the misleading uses of a historical artefact M_TRYWAIT with M_WAIT. 2008-03-25 09:39:02 +00:00
netatm Replaced the misleading uses of a historical artefact M_TRYWAIT with M_WAIT. 2008-03-25 09:39:02 +00:00
netgraph Several changes breaking netgraph module ABI collected together: 2008-04-15 21:15:32 +00:00
netinet Use the pru_flush infrastructure to avoid a panic 2008-04-14 18:13:33 +00:00
netinet6 - Have SCTP use the new pru_flush functionality 2008-04-14 18:12:37 +00:00
netipsec Fix a bug that when getting/dumping the soft lifetime we reported 2008-03-24 15:01:20 +00:00
netipx Make tcpstates[] static, and make sure TCPSTATES is defined before 2007-07-30 11:06:42 +00:00
netnatm
netncp lockmgrs need to be released before to be destroyed and draining doesn't 2008-03-30 18:16:33 +00:00
netsmb Really, smb_iod_main() is not totally MPSAFE, so just acquire and drop 2008-03-27 01:23:59 +00:00
nfs Replaced the misleading uses of a historical artefact M_TRYWAIT with M_WAIT. 2008-03-25 09:39:02 +00:00
nfs4client Move the head of byte-level advisory lock list from the 2008-04-16 11:33:32 +00:00
nfsclient Move the head of byte-level advisory lock list from the 2008-04-16 11:33:32 +00:00
nfsserver Replaced the misleading uses of a historical artefact M_TRYWAIT with M_WAIT. 2008-03-25 09:39:02 +00:00
nlm Tighten up the error-handling in nlm_get_rpc. While I'm here, fix a 2008-04-16 09:09:50 +00:00
opencrypto Make ftruncate a 'struct file' operation rather than a vnode operation. 2008-01-07 20:05:19 +00:00
pc98 MFi386: RTC related cleanups. 2008-04-13 06:18:34 +00:00
pccard
pci It seems that RealTek 8129/8139 chip reports invalid length of 2008-04-10 01:06:05 +00:00
powerpc Get rid of an empty RTC implementation and hook up genclock instead. 2008-04-13 21:20:26 +00:00
rpc Fix some issues that showed up during Kris' testing. 2008-04-11 10:34:59 +00:00
security Use __FBSDID() for $FreeBSD$ IDs in the audit code. 2008-04-13 22:06:56 +00:00
sparc64 - Add the interrupt vector number to intr_event_create so MI code can 2008-04-11 03:26:41 +00:00
sun4v - Add the interrupt vector number to intr_event_create so MI code can 2008-04-11 03:26:41 +00:00
sys Move the head of byte-level advisory lock list from the 2008-04-16 11:33:32 +00:00
tools Introduce a standalone shell script for embedding MFS image. 2008-02-05 10:46:30 +00:00
ufs Move the head of byte-level advisory lock list from the 2008-04-16 11:33:32 +00:00
vm Introduce vm_reserv_reclaim_contig(). This function is used by 2008-04-06 18:09:28 +00:00
xdr Add the new kernel-mode NFS Lock Manager. To use it instead of the 2008-03-26 15:23:12 +00:00
Makefile o Add boot, gdb, nfsserver and opencrypto dirs to CSCOPEDIRS; sort. 2008-01-23 08:50:34 +00:00