Bug 26320

Summary: [mount] [patch] mountd breaks IRIX automounter
Product: Base System Reporter: bg <bg>
Component: binAssignee: Alfred Perlstein <alfred>
Status: Closed FIXED    
Severity: Affects Only Me CC: bg
Priority: Normal    
Version: 4.2-RELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description bg 2001-04-03 17:40:00 UTC
This problem really stems from a poorly designed mount protocol. When
using ONC/RPC over UDP, RPC requests and responses are limited to
8kbytes of data. If a RPC response can not fit into that limited space
the RPC will fail. The mountd protocol has a procedure
MOUNTPROC_EXPORT that returns a list of all exported file systems and
which machines are allowed to import it. If a server has many clients
and exports many file systems this RPC reply will no longer fit into
8kbytes!

Fortunately, only the list of exported file systems is relevant to
programs such as the automounter. It is thus possible to return an
abbreviated reply that uses a placeholder for the hosts lists.

Fix: The fix below first try to send a regular RPC reply, only when this
fails, an abbreviated reply is sent. The fix has been verified on 3.5
and 4.2 hosts.
How-To-Repeat: 
Set up a FreeBSD NFS file server and export many file systems to many
hosts. Verify that the output from showmount -e your.nfs.server is
really long (longer than 8k).

From a IRIX host, try ls /hosts/your.file.server/. The ls will
eventually fail. On the file server you will find a syslog entry
"can't send reply".
Comment 1 Alfred Perlstein freebsd_committer freebsd_triage 2002-07-12 00:22:14 UTC
Responsible Changed
From-To: freebsd-bugs->alfred

I'll take a look at this, I think we should make sure we have an error 
related to RPC size before sending an abbreviated reply, I'll see if we 
can do that easily before committing the attached patch.
Comment 2 Craig Rodrigues freebsd_committer freebsd_triage 2005-10-05 07:03:51 UTC
State Changed
From-To: open->closed

Patch committed in version 1.66 of mountd.c