History log of /freebsd-current/usr.sbin/rpc.lockd/lockd_lock.c
Revision Date Author Comments
# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 6372f2c8 01-Jun-2023 Elyes Haouas <ehaouas@noos.fr>

rpc.lockd: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653


# 2541accb 18-Apr-2023 John Baldwin <jhb@FreeBSD.org>

rpc.lockd: Use C89 function definitions.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D39530


# 2bbeada0 23-Jun-2021 Mark Johnston <markj@FreeBSD.org>

rpc.lockd: Use libc strnlen() instead of reimplementing it

No functional change intended.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation


# dae3a64f 26-Dec-2017 Eitan Adler <eadler@FreeBSD.org>

userland: Fix several typos and minor errors

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

Reviewed by: imp, benno


# df57947f 18-Nov-2017 Pedro F. Giffuni <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


# 47c5f8f2 13-Jun-2016 Enji Cooper <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


# cec77ff4 15-May-2016 Don Lewis <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


# 061c8165 11-Sep-2012 Kevin Lo <kevlo@FreeBSD.org>

Remove dead return code


# 3df5ecac 30-Dec-2011 Ulrich Spörlein <uqs@FreeBSD.org>

Spelling fixes for usr.sbin/


# 091c4c86 20-Dec-2010 Ulrich Spörlein <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


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# 856f34f9 11-Apr-2007 Jun Kuriyama <kuriyama@FreeBSD.org>

- Fix compilaton with DUMP_FILELOCK_VERBOSE.
- Use consistent "get_lock_matching_unlock" function name in
debuglog().


# fce89853 16-Jan-2007 Christian Brueffer <brueffer@FreeBSD.org>

Fix a typo in a comment, introduced in rev. 1.19.


# 84292608 04-Jan-2007 Matt Jacob <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


# 96f8e17c 04-Jan-2007 Matt Jacob <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


# bc1f62de 11-Aug-2006 Thomas Quinot <thomas@FreeBSD.org>

Remove extraneous trailing \0 in string literal.

MFC after: 2 weeks


# 7838f9dd 20-May-2005 Philippe Charnier <charnier@FreeBSD.org>

Add FBSDID. Add missing prototypes. Remove unused variables. Give variable
an initial value to silent compiler.


# 3d81d1ad 15-Jul-2004 Michael Reifenberger <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


# a7526044 16-May-2004 Stefan Farfeleder <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


# aba63820 16-Feb-2004 Alfred Perlstein <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.


# 75e40e46 26-Oct-2003 Peter Wemm <peter@FreeBSD.org>

Make this compile cleanly. It passes WARNS=2, but I haven't checked
it is so on more platforms.


# 86eb7cba 14-May-2003 Robert Watson <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>


# 0d28a40a 22-Mar-2002 Alfred Perlstein <alfred@FreeBSD.org>

Remove cast that's not needed.


# c4bc47ba 21-Mar-2002 Alfred Perlstein <alfred@FreeBSD.org>

Bring code to WARNS=3 level. Mostly fix unused variables.


# 4b4ec9b8 16-Jan-2002 Alfred Perlstein <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>


# 815ac496 02-Dec-2001 Alfred Perlstein <alfred@FreeBSD.org>

prototype functions and fix some line wrapping


# 5f07c7b2 19-Nov-2001 Alfred Perlstein <alfred@FreeBSD.org>

This completes the all partial file locking under NFS. The underlying
file is still completely covered by a flock(2) style lock, but we'll tackle
that at a later date.

Submitted by: "Andrew P. Lentvorski" <bsder@allcaps.org>


# b6dc41ba 17-Nov-2001 Alfred Perlstein <alfred@FreeBSD.org>

Cleanup.

use LIST_FOREACH,

add prototypes (functions should be made static probably),

change DEBUG=1 to LOCKD_DEBUG,

K&R function instantiation for functions with long args lists,

Move comments about functions from within to above the function,

Simplified some if/else logic and reduced nested blocks.

parens around 'return' argument (return FOO -> return (FOO))


# a4a8a04d 17-Nov-2001 Alfred Perlstein <alfred@FreeBSD.org>

Re-enable statd code.

Submitted by: "Andrew P. Lentvorski" <bsder@allcaps.org>


# 7e589b0b 17-Nov-2001 Alfred Perlstein <alfred@FreeBSD.org>

This adds in the full HW locking capability and should now make my rewrite
of the rpc.lockd fully compliant with the old file locking semantics.

Andrew will dig into the statd code next and then will attack the split
locking.

This also backs out a lot of the work I've done on making the code
more conformant with non-written style rules, but we'll revisit that
later.

Submitted by: "Andrew P. Lentvorski" <bsder@allcaps.org>


# 4945c132 15-Nov-2001 Alfred Perlstein <alfred@FreeBSD.org>

Bring in Andrew P. Lentvorski initial work on making lockd work,
this should get us closer so cleaner implementation.

Submitted by: Andrew P. Lentvorski <bsder@allcaps.org>


# 2663693c 13-Nov-2001 Alfred Perlstein <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.


# bad584e3 14-Oct-2001 Alfred Perlstein <alfred@FreeBSD.org>

Implement partial-file NFS lock testing.

Submitted by: "Andrew P. Lentvorski" <andrewl@io.com>


# 603c8667 17-Apr-2001 Alfred Perlstein <alfred@FreeBSD.org>

Implement client side NFS locks.

Obtained from: BSD/os
Import Ok'd by: mckusick, jkh, motd on builder.freebsd.org


# 8360efbd 18-Mar-2001 Alfred Perlstein <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