History log of /freebsd-head/usr.sbin/rpc.lockd/lockd_lock.c
Revision Date Author Comments
56640efcbe39386a0152f14fb18a314b85e7e014 27-Dec-2017 eadler <eadler@FreeBSD.org> userland: Fix several typos and minor errors

- duplicate words
- typos
- references to old versions of FreeBSD

Reviewed by: imp, benno
9da7bdde061c43b87cf9bb2852984b78e292b1e6 18-Nov-2017 pfg <pfg@FreeBSD.org> spdx: initial adoption of licensing ID tags.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.

Initially, only tag files that use BSD 4-Clause "Original" license.

RelNotes: yes
Differential Revision: https://reviews.freebsd.org/D13133
ee3e200276b0f5bb9f2ac8fe92f747892fc807e1 08-Jul-2016 ngie <ngie@FreeBSD.org> MFC r301871:

Add missing break in lock_partialfilelock(..) with NFS_RESERR

This will help ensure that the right error is trickled up when the
function is called if the lock status is NFS_RESERR

Tested with: fsx; svn info/svnversion (uses bdb locking); locktests from Bull http://nfsv4.bullopensource.org/tools/tests/locktest.php
CID: 1008161, 1304956
7c98c921f9b7e3a200c9a2641f2f3b8723fcd1d7 13-Jun-2016 ngie <ngie@FreeBSD.org> Add missing break in lock_partialfilelock(..) with NFS_RESERR

This will help ensure that the right error is trickled up when the
function is called if the lock status is NFS_RESERR

Differential Revision: https://reviews.freebsd.org/D6622
Reviewed by: rmacklem
Approved by: re (gjb)
Tested with: fsx; svn info/svnversion (uses bdb locking); locktests from Bull http://nfsv4.bullopensource.org/tools/tests/locktest.php
MFC after: 2 weeks
Reported by: Coverity
CID: 1008161, 1304956
Sponsored by: EMC / Isilon Storage Division
00d578928eca75be320b36d37543a7e2a4f9fbdb 27-May-2016 grehan <grehan@FreeBSD.org> Create branch for bhyve graphics import.
8c6956f245810cd96b774d9edd14887f7692ef24 23-May-2016 truckman <truckman@FreeBSD.org> MFC r299897

NULL releasedfl after calling deallocate_file_lock() which frees it
to avoid a use-after-free error in the debuglog() call at the top
of the loop.

Reported by: Coverity
CID: 1006080
926e08a0de3654ecc1704ce0890fa927f7862433 16-May-2016 truckman <truckman@FreeBSD.org> NULL releasedfl after calling deallocate_file_lock() which frees it
to avoid a use-after-free error in the debuglog() call at the top
of the loop.

Reported by: Coverity
CID: 1006080
MFC after: 1 week
eb1a5f8de9f7ea602c373a710f531abbf81141c4 21-Feb-2014 gjb <gjb@FreeBSD.org> Move ^/user/gjb/hacking/release-embedded up one directory, and remove
^/user/gjb/hacking since this is likely to be merged to head/ soon.

Sponsored by: The FreeBSD Foundation
6b01bbf146ab195243a8e7d43bb11f8835c76af8 27-Dec-2013 gjb <gjb@FreeBSD.org> Copy head@r259933 -> user/gjb/hacking/release-embedded for initial
inclusion of (at least) arm builds with the release.

Sponsored by: The FreeBSD Foundation
d9d56fe8c7f8adf29e88461da35a0b720314d121 11-Sep-2012 kevlo <kevlo@FreeBSD.org> Remove dead return code
415a3a9b966c1522657d435a1785904f41accc78 30-Dec-2011 uqs <uqs@FreeBSD.org> Spelling fixes for usr.sbin/
04f9658f5ccf72df9c57e4e218f11574121fc70f 20-Dec-2010 uqs <uqs@FreeBSD.org> rpc.lockd(8) WARNS cleanup

- Provide function prototype for nlm_syscall
- Don't assign a variable from the stack to a global var[1]
- Remove unused vars

Found by: clang static analyser [1]
Reviewed by: dfr
09f9c897d33c41618ada06fbbcf1a9b3812dee53 19-Oct-2010 jamie <jamie@FreeBSD.org> A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.
f1216d1f0ade038907195fc114b7e630623b402c 19-Mar-2010 delphij <delphij@FreeBSD.org> Create a custom branch where I will be able to do the merge.
19b6af98ec71398e77874582eb84ec5310c7156f 22-Nov-2008 dfr <dfr@FreeBSD.org> Clone Kip's Xen on stable/6 tree so that I can work on improving FreeBSD/amd64
performance in Xen's HVM mode.
cf5320822f93810742e3d4a1ac8202db8482e633 19-Oct-2008 lulf <lulf@FreeBSD.org> - Import the HEAD csup code which is the basis for the cvsmode work.
e143d4410166510509c5502bbf81f75c582c0ba0 12-Apr-2007 kuriyama <kuriyama@FreeBSD.org> - Fix compilaton with DUMP_FILELOCK_VERBOSE.
- Use consistent "get_lock_matching_unlock" function name in
debuglog().
a700f4820bde6ae70b2c5c9f2f7a9d23e3d6f9c7 16-Jan-2007 brueffer <brueffer@FreeBSD.org> Fix a typo in a comment, introduced in rev. 1.19.
5360d709621d5c9705b1340841146649940f2431 12-Jan-2007 mjacob <mjacob@FreeBSD.org> MFC 1.18-1.19: Add a function that checks for duplicate requests (based
on some fairly tight criteria) so we avoid having broken clients
spam rpc.lockd to death. Plus some whitespace.
38968561b2e133962fc129420977507e5a7ae310 04-Jan-2007 mjacob <mjacob@FreeBSD.org> some whitespace cleanup (which I usually don't bother with)
so I could note that the previous delta was:

Reviewed by: Mohan
3bc2efe5348c9a8b3576b986c86967e9c5f0c03a 04-Jan-2007 mjacob <mjacob@FreeBSD.org> Add a function that checks for duplicate requests (based
on some fairly tight criteria) so we avoid having broken
clients spam rpc.lockd to death.

PR: 107530
Obtained from: Doug Rudoff
MFC after: 1 week
855c799d227b850b1d1618b54dcd3879f9785a8a 31-Aug-2006 thomas <thomas@FreeBSD.org> MFC rev. 1.18 to RELENG_6:
Remove extraneous trailing \0 in string literal.
ca8128c8a27ab2e7e3dde5522a07672d58250bf0 11-Aug-2006 thomas <thomas@FreeBSD.org> Remove extraneous trailing \0 in string literal.

MFC after: 2 weeks
80a7e91a6f59170ea94cf7cc2ccd728e9717d96c 20-May-2005 charnier <charnier@FreeBSD.org> Add FBSDID. Add missing prototypes. Remove unused variables. Give variable
an initial value to silent compiler.
0dd47798742374a4b63f444cf19ffd56ca2f713d 16-Jul-2004 mr <mr@FreeBSD.org> After talking to Colin,
apply the patch of bin/61718 (which should include/elimatate kern/61122 also).
It seems to fix a few annoying bugs.

PR: bin/61718, kern/61122
Submitted by: bg@sics.se ohartman@mail.physik.uni-mainz.de
1b3274a8a0b010b7ed65bedc89f09a69ef92958d 16-May-2004 stefanf <stefanf@FreeBSD.org> Remove spurious semicolons. Outside of functions they are actually errors but
GCC doesn't warn about them without -pedantic.

Approved by: das (mentor)
PR: 56649
Reviewed by: md5
3ae5306cbc7344c3fae786db46d92a0fc16fa094 17-Feb-2004 alfred <alfred@FreeBSD.org> The callrpc call to unmonitor hosts was passing the wrong xdr
decode/encode functions for the arguments to the statd unmonitor
call. Fix it.
edafc1a965b6d0a67c9cb9b30c70c97a9ad09e3a 26-Oct-2003 peter <peter@FreeBSD.org> Make this compile cleanly. It passes WARNS=2, but I haven't checked
it is so on more platforms.
65e966433e0f29ff89cea7f419116ec01f24a8b2 14-May-2003 rwatson <rwatson@FreeBSD.org> Avoid registering for a lock on the server in the event the NFS client
has requested the lock in a non-blocking form, instead returning an
immediate failure. This appears to help reduce one of my "locks get
lost" symptoms involving lockf(1), which attempts a non-blocking lock
attempt before actually blocking on the lock. At this point the client
still gets back EACCES, which is an issue we're still working.

Approved by: re (scottl)
Submitted by: Andrew P. Lentvorski, Jr. <bsder@allcaps.org>
2eea86bbd44c12d82f61ccb3693be0a522e05630 22-Mar-2002 alfred <alfred@FreeBSD.org> Remove cast that's not needed.
454845084c112df969ca14adced4fd6c1d7305b6 21-Mar-2002 alfred <alfred@FreeBSD.org> Bring code to WARNS=3 level. Mostly fix unused variables.
2b493fd00cbf2281e3d7b72202627af22d8f4349 17-Jan-2002 alfred <alfred@FreeBSD.org> Fix boundry condition in lock management:

Alfred, I took a look at retry_blockingfilelocklist() and the
solution seemed simple enough. Please correct me if I am wrong.
It seems said routine doesn't take into account boundary conditions
when putting back file_lock entries into the blocked lock-list.
Specifically, it fails when the file_lock being put back is the
last element in the list, and when it is the only element in the
list. I've included a patch below.

Basically, it introduces another variable: pfl, which keeps track
of the list item before ifl. That way if nfl is NULL, ifl gets
inserted after pfl. If pfl is also NULL, then it gets inserted
at the head of the list (since it was the only element in the
list).

Submitted by: Mike Makonnen <mike_makonnen@yahoo.com>
Tested by: Thomas Quinot <thomas@cuivre.fr.eu.org>
31de5a15a87078097f7330b01f604a9d72d38576 02-Dec-2001 alfred <alfred@FreeBSD.org> prototype functions and fix some line wrapping
0190d29f9ab409df6cf6bb3029c2449212b91469 29-Nov-2001 alfred <alfred@FreeBSD.org> Fold ANDREW_LOCKD into -current.
286faba5487469ccabb21c244ccd470ad5d111c9 13-Nov-2001 alfred <alfred@FreeBSD.org> Turn on NO_WERROR and set WARNS to 1.

Fix the WARNS 1 warnings except unused variables.

Add prototype for log_netobj().
Don't compare signed/unsigned.
Cast u_int64_t to 'unsigned long long' and print using %llu.
Fix constness of string arrays.
Use a cast to avoid an unused parameter in a signal handler.
alarm(2) can't fail, so don't check for it.
ANSI'ify some functions.
8dd54dc1741b2f7b46d6ced09abf391310734eec 14-Oct-2001 alfred <alfred@FreeBSD.org> Implement partial-file NFS lock testing.

Submitted by: "Andrew P. Lentvorski" <andrewl@io.com>
f0669d6c9e71dffa3f4104a202e3e1046c64021c 17-Apr-2001 alfred <alfred@FreeBSD.org> Implement client side NFS locks.

Obtained from: BSD/os
Import Ok'd by: mckusick, jkh, motd on builder.freebsd.org
f67e4a8fc7fc95c74bd6c09d3453200de47faea5 19-Mar-2001 alfred <alfred@FreeBSD.org> Bring in a hybrid of SunSoft's transport-independent RPC (TI-RPC) and
associated changes that had to happen to make this possible as well as
bugs fixed along the way.

Bring in required TLI library routines to support this.

Since we don't support TLI we've essentially copied what NetBSD
has done, adding a thin layer to emulate direct the TLI calls
into BSD socket calls.

This is mostly from Sun's tirpc release that was made in 1994,
however some fixes were backported from the 1999 release (supposedly
only made available after this porting effort was underway).

The submitter has agreed to continue on and bring us up to the
1999 release.

Several key features are introduced with this update:
Client calls are thread safe. (1999 code has server side thread
safe)
Updated, a more modern interface.

Many userland updates were done to bring the code up to par with
the recent RPC API.

There is an update to the pthreads library, a function
pthread_main_np() was added to emulate a function of Sun's threads
library.

While we're at it, bring in NetBSD's lockd, it's been far too
long of a wait.

New rpcbind(8) replaces portmap(8) (supporting communication over
an authenticated Unix-domain socket, and by default only allowing
set and unset requests over that channel). It's much more secure
than the old portmapper.

Umount(8), mountd(8), mount_nfs(8), nfsd(8) have also been upgraded
to support TI-RPC and to support IPV6.

Umount(8) is also fixed to unmount pathnames longer than 80 chars,
which are currently truncated by the Kernel statfs structure.

Submitted by: Martin Blapp <mb@imp.ch>
Manpage review: ru
Secure RPC implemented by: wpaul