OpenBSD CVS

CVS log for src/sys/sys/lockf.h


[BACK] Up to [local] / src / sys / sys

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.17 / (download) - annotate - [select for diffs], Sat Apr 20 08:28:59 2019 UTC (5 years, 1 month ago) by anton
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, HEAD
Changes since 1.16: +3 -36 lines
Diff to previous 1.16 (colored)

Move lockf structures from header to implementation since external users
only need a lockf_state pointer by now.

ok mpi@ visa@

Revision 1.16 / (download) - annotate - [select for diffs], Fri Apr 19 09:41:07 2019 UTC (5 years, 1 month ago) by visa
Branch: MAIN
Changes since 1.15: +2 -2 lines
Diff to previous 1.15 (colored)

Add a subsystem lock for vfs_lockf.c. This enables calling lf_advlock()
and lf_purgelocks() without the kernel lock.

OK anton@ mpi@

Revision 1.15 / (download) - annotate - [select for diffs], Sun Mar 31 11:33:11 2019 UTC (5 years, 2 months ago) by visa
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.14: +1 -20 lines
Diff to previous 1.14 (colored)

Move the prototypes of internal lockf functions from <sys/lockf.h>
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@

Revision 1.14 / (download) - annotate - [select for diffs], Wed Jan 30 17:04:04 2019 UTC (5 years, 4 months ago) by anton
Branch: MAIN
Changes since 1.13: +7 -9 lines
Diff to previous 1.13 (colored)

Replace hand rolled linked list with TAILQ. All made possible by the recent
introduction of struct lockf_state.

ok bluhm@ visa@

Revision 1.13 / (download) - annotate - [select for diffs], Mon Jan 21 18:09:21 2019 UTC (5 years, 4 months ago) by anton
Branch: MAIN
Changes since 1.12: +12 -4 lines
Diff to previous 1.12 (colored)

Introduce a dedicated entry point data structure for file locks. This new data
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

Revision 1.9.22.1 / (download) - annotate - [select for diffs], Sat Nov 17 19:11:14 2018 UTC (5 years, 6 months ago) by tb
Branch: OPENBSD_6_4
Changes since 1.9: +5 -2 lines
Diff to previous 1.9 (colored) next main 1.10 (colored)

A recent change to POSIX file locks could cause incorrect results during
lock acquisition.

OpenBSD 6.4 errata 004

Revision 1.9.16.1 / (download) - annotate - [select for diffs], Sat Nov 17 19:03:57 2018 UTC (5 years, 6 months ago) by tb
Branch: OPENBSD_6_3
Changes since 1.9: +5 -2 lines
Diff to previous 1.9 (colored) next main 1.10 (colored)

A recent change to POSIX file locks could cause incorrect results during
lock acquisition.

OpenBSD 6.3 errata 023

Revision 1.12 / (download) - annotate - [select for diffs], Fri Nov 2 07:15:03 2018 UTC (5 years, 7 months ago) by anton
Branch: MAIN
Changes since 1.11: +1 -3 lines
Diff to previous 1.11 (colored)

disable LOCKF_DIAGNOSTIC

Revision 1.11 / (download) - annotate - [select for diffs], Sat Oct 27 08:53:35 2018 UTC (5 years, 7 months ago) by anton
Branch: MAIN
Changes since 1.10: +3 -1 lines
Diff to previous 1.10 (colored)

Temporarily enable LOCKF_DIAGNOSTIC in order to catch potential bugs.

ok deraadt@ visa@ (as part of a larger diff)

Revision 1.10 / (download) - annotate - [select for diffs], Sat Oct 27 08:47:09 2018 UTC (5 years, 7 months ago) by anton
Branch: MAIN
Changes since 1.9: +5 -2 lines
Diff to previous 1.9 (colored)

Rework previous lockf fix; bluhm@ noticed a regress failure during consecutive
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@

Revision 1.9 / (download) - annotate - [select for diffs], Sun Mar 24 17:45:25 2013 UTC (11 years, 2 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_3_BASE, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9, OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7, OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4
Branch point for: OPENBSD_6_4, OPENBSD_6_3
Changes since 1.8: +5 -2 lines
Diff to previous 1.8 (colored)

hide some kernel functions from userland

Revision 1.8 / (download) - annotate - [select for diffs], Fri Sep 19 12:24:55 2008 UTC (15 years, 8 months ago) by art
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.7: +2 -1 lines
Diff to previous 1.7 (colored)

Fix a bunch of problems and races with posix file locking.

- 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

Revision 1.7 / (download) - annotate - [select for diffs], Thu Mar 10 17:26:10 2005 UTC (19 years, 3 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0, OPENBSD_3_9_BASE, OPENBSD_3_9, OPENBSD_3_8_BASE, OPENBSD_3_8, OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.6: +2 -1 lines
Diff to previous 1.6 (colored)

split out uidinfo from kern_proc.c private, use it to store lock count,
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

Revision 1.2.16.4 / (download) - annotate - [select for diffs], Thu Feb 19 11:01:33 2004 UTC (20 years, 3 months ago) by niklas
Branch: SMP
Changes since 1.2.16.3: +2 -1 lines
Diff to previous 1.2.16.3 (colored) to branchpoint 1.2 (colored) next main 1.3 (colored)

Merge of current from two weeks agointo the SMP branch

Revision 1.6 / (download) - annotate - [select for diffs], Wed Jan 14 19:34:05 2004 UTC (20 years, 5 months ago) by grange
Branch: MAIN
CVS Tags: SMP_SYNC_B, SMP_SYNC_A, OPENBSD_3_6_BASE, OPENBSD_3_6, OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.5: +2 -1 lines
Diff to previous 1.5 (colored)

Get rid of M_LOCKF and use pool for allocating lockf structures.
 From NetBSD.

Tested by many people, ok art@.

Revision 1.2.16.3 / (download) - annotate - [select for diffs], Sat Jun 7 11:09:07 2003 UTC (21 years ago) by ho
Branch: SMP
Changes since 1.2.16.2: +2 -6 lines
Diff to previous 1.2.16.2 (colored) to branchpoint 1.2 (colored)

Sync SMP branch to -current

Revision 1.5 / (download) - annotate - [select for diffs], Mon Jun 2 23:28:21 2003 UTC (21 years ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.4: +2 -6 lines
Diff to previous 1.4 (colored)

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999.  Proofed by myself and Theo.

Revision 1.3.4.1 / (download) - annotate - [select for diffs], Tue Jun 11 03:32:33 2002 UTC (22 years ago) by art
Branch: UBC
Changes since 1.3: +13 -13 lines
Diff to previous 1.3 (colored) next main 1.4 (colored)

Sync UBC branch to -current

Revision 1.2.16.2 / (download) - annotate - [select for diffs], Thu Mar 28 14:52:01 2002 UTC (22 years, 2 months ago) by niklas
Branch: SMP
Changes since 1.2.16.1: +13 -13 lines
Diff to previous 1.2.16.1 (colored) to branchpoint 1.2 (colored)

Merge in -current from roughly a week ago

Revision 1.4 / (download) - annotate - [select for diffs], Thu Mar 14 01:27:14 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: UBC_SYNC_B, UBC_SYNC_A, OPENBSD_3_3_BASE, OPENBSD_3_3, OPENBSD_3_2_BASE, OPENBSD_3_2, OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.3: +13 -13 lines
Diff to previous 1.3 (colored)

First round of __P removal in sys

Revision 1.2.16.1 / (download) - annotate - [select for diffs], Wed Jul 4 11:00:22 2001 UTC (22 years, 11 months ago) by niklas
Branch: SMP
Changes since 1.2: +5 -3 lines
Diff to previous 1.2 (colored)

Merge in -current from two days ago in the SMP branch.
As usual with merges, they do not indicate progress, so do not hold
your breath for working SMP, and do not mail me and ask about the
state of it.  It has not changed.  There is work ongoing, but very, very
slowly.  The commit is done in parts as to not lock up the tree in too
big chunks at a time.

Revision 1.3 / (download) - annotate - [select for diffs], Wed Jun 20 23:23:14 2001 UTC (22 years, 11 months ago) by gluk
Branch: MAIN
CVS Tags: UBC_BASE, OPENBSD_3_0_BASE, OPENBSD_3_0
Branch point for: UBC
Changes since 1.2: +5 -3 lines
Diff to previous 1.2 (colored)

Fix PR1826. tsleep in lf_setlock can return 0 if process was ptrace'd,
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

Revision 1.2 / (download) - annotate - [select for diffs], Sun Mar 3 12:11:57 1996 UTC (28 years, 3 months ago) by niklas
Branch: MAIN
CVS Tags: kame_19991208, SMP_BASE, OPENBSD_2_9_BASE, OPENBSD_2_9, OPENBSD_2_8_BASE, OPENBSD_2_8, OPENBSD_2_7_BASE, OPENBSD_2_7, OPENBSD_2_6_BASE, OPENBSD_2_6, OPENBSD_2_5_BASE, OPENBSD_2_5, OPENBSD_2_4_BASE, OPENBSD_2_4, OPENBSD_2_3_BASE, OPENBSD_2_3, OPENBSD_2_2_BASE, OPENBSD_2_2, OPENBSD_2_1_BASE, OPENBSD_2_1, OPENBSD_2_0_BASE, OPENBSD_2_0
Branch point for: SMP
Changes since 1.1: +1 -0 lines
Diff to previous 1.1 (colored)

From NetBSD: 960217 merge

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Wed Oct 18 08:53:27 1995 UTC (28 years, 8 months ago) by deraadt
CVS Tags: netbsd_1_1
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored)

initial import of NetBSD tree

Revision 1.1 / (download) - annotate - [select for diffs], Wed Oct 18 08:53:27 1995 UTC (28 years, 8 months ago) by deraadt
Branch: MAIN

Initial revision

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.