summaryrefslogtreecommitdiffstats
path: root/sys/sys/lockf.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Move lockf structures from header to implementation since external usersanton2019-04-201-36/+3
| | | | | | only need a lockf_state pointer by now. ok mpi@ visa@
* Add a subsystem lock for vfs_lockf.c. This enables calling lf_advlock()visa2019-04-191-2/+2
| | | | | | and lf_purgelocks() without the kernel lock. OK anton@ mpi@
* Move the prototypes of internal lockf functions from <sys/lockf.h>visa2019-03-311-20/+1
| | | | | | | | | to vfs_lockf.c. This makes the public interface clearer. The declaration of variable lockf_debug is removed from the header because it is not needed outside of vfs_lockf.c. OK anton@ tedu@
* Replace hand rolled linked list with TAILQ. All made possible by the recentanton2019-01-301-9/+7
| | | | | | introduction of struct lockf_state. ok bluhm@ visa@
* Introduce a dedicated entry point data structure for file locks. This new dataanton2019-01-211-4/+12
| | | | | | | | | | | | structure allows for better tracking of pending lock operations which is essential in order to prevent a use-after-free once the underlying vnode is gone. Inspired by the lockf implementation in FreeBSD. ok visa@ Reported-by: syzbot+d5540a236382f50f1dac@syzkaller.appspotmail.com
* disable LOCKF_DIAGNOSTICanton2018-11-021-3/+1
|
* Temporarily enable LOCKF_DIAGNOSTIC in order to catch potential bugs.anton2018-10-271-1/+3
| | | | ok deraadt@ visa@ (as part of a larger diff)
* Rework previous lockf fix; bluhm@ noticed a regress failure during consecutiveanton2018-10-271-2/+5
| | | | | | | | runs. This is a second attempt in which the lockf structure is turned into a doubly linked list which makes it easier to ensure correctness during list insertion and deletion. ok deraadt@ visa@
* hide some kernel functions from userlandderaadt2013-03-241-2/+5
|
* Fix a bunch of problems and races with posix file locking.art2008-09-191-1/+2
| | | | | | | | | | | | | | | | - file descriptor table becomes the owner of the lock instead of the proc. - When grabbing the lock, we check if the fd hasn't changed under our feet, this is more or less impossible to solve without a hack like this. I've banged my head against the wall, I figured out a solution, but implementing it correctly would cost me 12 gray hairs. Screw it, this is ugly, but it works. - Wait until usecount drains before releasing the posix lock in closef. - Add missing FREF/FRELE to sys_flock - keep the pid in the flock struct instead of abusing the fact that we used to use the proc as the lock owner. Pointed out by and discussed with Al Viro, big thanks. miod@ ok
* split out uidinfo from kern_proc.c private, use it to store lock count,tedu2005-03-101-1/+2
| | | | | | restrict lock count per uid to a global limit, add sysctl to adjust limit. this prevents a user from creating too many locks. problem noticed by devon o'dell. ok deraadt miod pedro
* Get rid of M_LOCKF and use pool for allocating lockf structures.grange2004-01-141-1/+2
| | | | | | From NetBSD. Tested by many people, ok art@.
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-021-6/+2
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* First round of __P removal in sysmillert2002-03-141-13/+13
|
* Fix PR1826. tsleep in lf_setlock can return 0 if process was ptrace'd,gluk2001-06-201-3/+5
| | | | | | | | | | | | | | | | | | | | | but not wakeup'ed. In this case one entry can be placed twice at list of blocked locks. As a result block list contain an entry which points to itself. lf_wakelock can't remove such an entry and system livelocks trying to remove a bad entry from block list. Other changes include: - repair debug functions and make vfs_lockf.c compilable with LOCKF_DEBUG - simplify debug printing and remove useless debugging - remove unnecessary casting, replace NOLOCKF with NULL - free -> FREE (use one form over the file) - convert list of blocked locks to use TAILQ_* macroses - lf_addblock() -> TAILQ_INSERT_TAIL - Fix bug in lf_findoverlap(): in old code if (end == -1) && (lf->lf_end == -1) && (lf->lf_start <= start) then lf_findoverlap() return 4 instead of 2 - work more carefully with pointers (probably fix one or two bugs) - use wakeup_one() - KNF
* From NetBSD: 960217 mergeniklas1996-03-031-0/+1
|
* initial import of NetBSD treederaadt1995-10-181-0/+83