kernel_optimize_test/fs/lockd
Chuck Lever 94da7663db NSM: Replace IP address as our nlm_reboot lookup key
NLM provides file locking services for NFS files.  Part of this service
includes a second protocol, known as NSM, which is a reboot
notification service.  NLM uses this service to determine when to
reclaim locks or enter a grace period after a client or server reboots.

The NLM service (implemented by lockd in the Linux kernel) contacts
the local NSM service (implemented by rpc.statd in Linux user space)
via NSM protocol upcalls to register a callback when a particular
remote peer reboots.

To match the callback to the correct remote peer, the NLM service
constructs a cookie that it passes in the request.  The NSM service
passes that cookie back to the NLM service when it is notified that
the given remote peer has indeed rebooted.

Currently on Linux, the cookie is the raw 32-bit IPv4 address of the
remote peer.  To support IPv6 addresses, which are larger, we could
use all 16 bytes of the cookie to represent a full IPv6 address,
although we still can't represent an IPv6 address with a scope ID in
just 16 bytes.

Instead, to avoid the need for future changes to support additional
address types, we'll use a manufactured value for the cookie, and use
that to find the corresponding nsm_handle struct in the kernel during
the NLMPROC_SM_NOTIFY callback.

This should provide complete support in the kernel's NSM
implementation for IPv6 hosts, while remaining backwards compatible
with older rpc.statd implementations.

Note we also deal with another case where nsm_use_hostnames can change
while there are outstanding notifications, possibly resulting in the
loss of reboot notifications.  After this patch, the priv cookie is
always used to lookup rebooted hosts in the kernel.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
2009-01-06 11:53:55 -05:00
..
clntlock.c NLM: allow lockd requests from an unprivileged port 2008-12-23 15:21:38 -05:00
clntproc.c NLM: Remove redundant printk() in nlmclnt_lock() 2009-01-06 11:53:51 -05:00
grace.c nfsd: common grace period control 2008-10-03 16:19:02 -04:00
host.c NLM: Remove "create" argument from nsm_find() 2009-01-06 11:53:54 -05:00
Makefile nfsd: common grace period control 2008-10-03 16:19:02 -04:00
mon.c NSM: Replace IP address as our nlm_reboot lookup key 2009-01-06 11:53:55 -05:00
svc.c lockd: set svc_serv->sv_maxconn to a more reasonable value (try #3) 2009-01-06 11:53:48 -05:00
svc4proc.c NLM: Change nlm_host_rebooted() to take a single nlm_reboot argument 2009-01-06 11:53:54 -05:00
svclock.c lockd: reject reclaims outside the grace period 2008-10-03 16:19:20 -04:00
svcproc.c NLM: Change nlm_host_rebooted() to take a single nlm_reboot argument 2009-01-06 11:53:54 -05:00
svcshare.c lockd: fix sparse warning in svcshare.c 2008-04-23 16:13:39 -04:00
svcsubs.c lockd: Teach nlm_cmp_addr() to support AF_INET6 addresses 2008-09-29 18:13:39 -04:00
xdr.c NLM: Decode "priv" argument of NLMPROC_SM_NOTIFY as an opaque 2009-01-06 11:53:54 -05:00
xdr4.c NLM: Decode "priv" argument of NLMPROC_SM_NOTIFY as an opaque 2009-01-06 11:53:54 -05:00