Commit Graph

71 Commits

Author SHA1 Message Date
cognet
64b8fa6ad4 Consumers of nfslockdans() seems to think it should return 0 on success, so
make it so.
2005-03-16 23:55:48 +00:00
ru
acf39e5db0 Fixed the misplaced $FreeBSD$. 2005-02-09 18:07:17 +00:00
kuriyama
b5af69a877 - Use svc_getrpccaller() rather than svc_getcaller() for using
xt_rtaddr member of SVCXPRT structure.  This allows to use IPv6
  address stored in "struct sockaddr_storage" in "struct netbuf".
- Output the reason of getnameinfo() error.

Reviewed by:	alfred
2005-02-03 22:21:19 +00:00
ru
9a0f1e9891 Sort sections. 2005-01-18 20:02:45 +00:00
phk
a9b6719ed7 Userland change corresponding to the change in kernel/userland communication
for NFS locking.
2004-12-06 08:32:09 +00:00
stefanf
ee6365c442 Include <unistd.h> for {g,s}eteuid(). 2004-10-09 15:36:13 +00:00
mr
5863196df1 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
2004-07-16 12:50:10 +00:00
stefanf
0e7925249c 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
2004-05-16 22:08:17 +00:00
roam
45db403b8a Make rpc.lockd bind to a reserved port, since there are NFS clients
which ignore NLM requests not coming from a reserved port.

PR:		56500
Submitted by:	Jonathan Lennox <lennox@cs.columbia.edu>
MFC after:	1 week
2004-03-04 15:52:28 +00:00
alfred
95ad51e15b The callrpc call to unmonitor hosts was passing the wrong xdr
decode/encode functions for the arguments to the statd unmonitor
call.  Fix it.
2004-02-17 00:13:59 +00:00
peter
9526d22643 Make this compile cleanly. It passes WARNS=2, but I haven't checked
it is so on more platforms.
2003-10-26 06:10:44 +00:00
rwatson
a03eae91f7 When getting back an NLM DENIED response for a requested lock from the
server, map it to EAGAIN locally rather than EACCES.  The NLM spec
indicates the DENIED corresponds to lock contention, not a permission
failure.  This fixes O_EXLOCK/O_SHLOCK with O_NONBLOCK, which would
previously give a permission error, which in turn fixes things
like mailq(8) and lockf(1) over NFS.

Approved by:	scottl (re)
Reviewed by:	truckman, Andrew P Lentvorski, Jr. <bsder@allcaps.org>
Idea from:	truckman
2003-05-15 03:19:30 +00:00
rwatson
b023718583 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>
2003-05-14 21:16:33 +00:00
rwatson
81b0ed0e1f When receiving NLM_GRANTED_RES or NLM4_GRANTED_RES lock granted messages
from the NFS server, following contention on a lock by this or another
client, immediately notify the waiting process that the lock has been
granted via a wakeup.  Without this change, the client rpc.lockd will
not wakeup the waiting process until it next re-polls the lock (sometime
in the next ten seconds), which can lead to marked latency across all
potential lockers, as the lock is held by the client for the duration.

Approved by:	re (scottl)
Submitted by:	truckman
Reviewed by:	Andrew P. Lentvorski, Jr <bsder@allcaps.org>
2003-05-14 13:50:40 +00:00
ghelmer
7eb6aa4263 init_nsm() is executed after a call to daemon(*, 0), so error and
warning messages should be logged rather than sent to /dev/null.

PR:	bin/45461
2003-04-24 14:38:42 +00:00
obrien
6709fe0c57 style.Makefile(5) 2003-04-04 17:49:21 +00:00
mbr
a5173e4613 Implement nonblocking tpc-connections. rpcgen -m does still
produce backcompatible code.

Reviewed by:	rwatson
Obtained from:	NetBSD
MFC after:	1 day
2003-01-16 07:27:30 +00:00
alfred
529e316712 Remove a case of exposing 'struct ucred' to userspace. Use a struct xucred
for LOCKD_MSG instead.

Requested by: rwatson
2002-08-15 21:52:22 +00:00
alfred
117ddfb9e5 Add IPv6 support.
Submitted by: Jean-Luc Richier <Jean-Luc.Richier@imag.fr>
2002-07-15 19:40:23 +00:00
charnier
90baea60d8 The .Nm utility 2002-07-14 14:47:15 +00:00
alfred
a553940387 When binding to transports if getnetconfigent() fails then actually
print out the correct transport it failed on rather than always
spitting out 'udp', also call nc_sperror() to give a more verbose
error message detailing the problem.
2002-04-11 07:19:30 +00:00
alfred
7a9725738b Use char foo[] = "BAR" to avoid direct assignment of const char * into char *.
rpcgen can't really make those fields const because the remote side might
want to munge them, so we need to pass non-const in.  Hackish, but should
work.
2002-03-22 20:02:54 +00:00
alfred
3bb6263065 Const fix. 2002-03-22 20:00:10 +00:00
alfred
a518a57745 Remove cast that's not needed. 2002-03-22 19:57:09 +00:00
alfred
4ca456bc07 WARNS from 3 to 4. still some warnings about assigning const char * to
char *, but we'll fix those later.
2002-03-22 19:50:58 +00:00
alfred
919657358b constify log_from_addr() parameter. 2002-03-22 19:20:35 +00:00
alfred
2119d73ec0 Bring code to WARNS=3 level. Mostly fix unused variables. 2002-03-21 23:05:13 +00:00
alfred
8df6a8d168 Remove main() prototype. 2002-03-21 22:53:49 +00:00
alfred
9d874c3f4f Remove __P. 2002-03-21 22:52:45 +00:00
alfred
e3b91e44be 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>
2002-01-17 00:12:05 +00:00
alfred
d04da8c6e3 prototype functions and fix some line wrapping 2001-12-02 11:10:46 +00:00
alfred
ae6037f302 Fold ANDREW_LOCKD into -current. 2001-11-29 17:36:45 +00:00
alfred
9096a55649 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.
2001-11-13 11:24:23 +00:00
alfred
f346b43fb4 fix parameters to lock_answer().
Submitted by: Timo Geusch <freebsd@unix-consult.com>
2001-11-12 16:34:59 +00:00
alfred
c6fc5d3446 Fixup for WARNS. 2001-11-12 16:29:45 +00:00
alfred
263d859358 Drop privs while servicing kernel lock requests.
Restore umask used before FIFO creation.
If opening the FIFO fails, exit.
Properly check the return value of open (use == -1 instead of < 0).
2001-11-11 23:40:10 +00:00
alfred
9083df7cf5 leverage fixed fifo implementation (rev 1.56 of
src/sys/fs/fifofs/fifo_vnops.c) to serve locks better, my previous
workaround for lack of decent fifo system wasn't cutting it,
particularly the kernel would send a message down the fifo and
immediately close it, this would lead to delayed unlock requests
being seen by the lockd causing all sorts of badness.

Basically, don't reopen the fifo, just select(2) on it.
2001-11-08 10:37:32 +00:00
alfred
2ba2d8f465 use syslog rather than printf so we can see what's going on in debug mode 2001-11-08 10:34:21 +00:00
alfred
dd3d672777 style fixes, fix line wrap and function declaration 2001-11-08 10:33:41 +00:00
alfred
40fe534cfd Implement partial-file NFS lock testing.
Submitted by: "Andrew P. Lentvorski" <andrewl@io.com>
2001-10-14 18:36:35 +00:00
peter
860188b5bf Userland part of nfs client/server split and cleanup. 2001-09-18 23:34:44 +00:00
obrien
4b92fa588b Perform a major cleanup of the usr.sbin Makefiles.
These are not perfectly in agreement with each other style-wise, but they
are orders of orders of magnitude more consistent style-wise than before.
2001-07-20 06:20:32 +00:00
alfred
5eff86b8cd Distinguish between rpc version numbers in the client cache to avoid
replying on the wrong port.
2001-04-28 04:26:32 +00:00
alfred
deb1016746 handles.c belonged to the old stub lockd, nuke it. 2001-04-28 02:19:15 +00:00
alfred
a8da103d65 procs.c belonged to the old stub lockd, nuke it. 2001-04-28 02:17:33 +00:00
ru
34d6481dd2 mdoc(7) police: Removed forgotten .Pp. 2001-04-27 10:18:22 +00:00
alfred
061236a372 Fix compiling without -O, some dead code was using non-existant functions,
make the code not automatically dead but actually use the debug level
in order to determine if output is needed.  Fix non-existant from_addr()
by #define'ing it to inet_ntoa().

Remove hardcoded -g from Makefile.

Reported by: "John W. De Boskey" <jwd@bsdwins.com>
Tested by: "John W. De Boskey" <jwd@bsdwins.com>
2001-04-25 18:40:38 +00:00
alfred
0c62408904 Remove section from bugs that says we don't support client locks.
Pointed out by: Martin Blapp <mb@imp.ch>
2001-04-19 12:29:43 +00:00
alfred
9f1f7e7991 remove debug code left in by accident 2001-04-18 21:41:27 +00:00
alfred
7cae9abd49 Implement client side NFS locks.
Obtained from: BSD/os
Import Ok'd by: mckusick, jkh, motd on builder.freebsd.org
2001-04-17 20:45:23 +00:00