]> git.decadent.org.uk Git - nfs-utils.git/commit - utils/mountd/cache.c
rpc.mountd: add new mode for handling netgroup-heavy configurations
authorJeff Layton <jlayton@redhat.com>
Thu, 27 Sep 2007 10:54:04 +0000 (06:54 -0400)
committerNeil Brown <neilb@suse.de>
Fri, 28 Sep 2007 01:39:57 +0000 (11:39 +1000)
commit7a042b78ba064a36d1c7de797d2af796212fca2e
treec4fb08ef0896a113aafa695dbe44eca14040ba43
parent180238a295c1a8127953c96f0b462688d0f57a09
rpc.mountd: add new mode for handling netgroup-heavy configurations

If a host is a member of a large number of netgroups, it becomes easily
possible for client_compose to generate a m_hostname string that
overflows the maximum string length allowed by the kernel caches.

This patch adds a new mode for mountd where it will map IP address to IP
address in the auth.unix.ip cache. When this enabled, mountd doesn't
bother using client_compose to build the m_hostname string. It just
populates it with the dotted-quad ip address. When mountd handles a
mount request, it then has an IP address and a path. It then calls
client_check to check the host against export entries where the path has
already matched.

Since we don't bother looking up netgroups which have no relation to the
mount, this can be a big performance gain in netgroup-heavy
configurations.  The downside is that every host has a corresponding
entry in the nfsd.export and nfsd.fh caches as well as the auth.unix.ip
cache.

The new behavior is automatically enabled if the length of all of the
concatenated netgroup names in the export table is longer than half
NFSCLNT_IDMAX. The rationale for this logic is that this should allow
for a host to be a member of a long list of netgroups while still
allowing for other matches.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Acked-by: Steve Dickson <steved@redhat.com>
Signed-off-by: Neil Brown <neilb@suse.de>
utils/mountd/auth.c
utils/mountd/cache.c
utils/mountd/mountd.c