| Summary: | AutoFS seems to disturb NFS server | ||
|---|---|---|---|
| Product: | Base System | Reporter: | dlt_cjo |
| Component: | kern | Assignee: | Edward Tomasz Napierala <trasz> |
| Status: | Closed Not A Bug | ||
| Severity: | Affects Some People | CC: | amd64, rmacklem, trasz |
| Priority: | --- | ||
| Version: | 10.2-RELEASE | ||
| Hardware: | amd64 | ||
| OS: | Any | ||
|
Description
dlt_cjo
2016-03-16 19:42:04 UTC
To clarify: the problem occurs when trying to automount an NFS share on the NFS server itself, right? Does it also occur if you try to mount the share by hand (mount -t nfs)? (In reply to Edward Tomasz Napierala from comment #1) Yes - this happens when automounting from the server. It does in fact, do that when I mount by hand on the server on the server as well..Something I didn't test. I was also able to duplicate on 9.3-RELEASE-p21 machine that does not use AutoFS by mounting another export by hand. I was unable to duplicate on NFS servers running Linux kernel 3.16.0 and 2.6.32 with the same nfs client machine running iozone for reference. This is what the NFS related things look like in my rc.conf: (Maybe I'm doing something that is incorrect) mountd_enable="YES" rpcbind_enable="YES" rpc_lockd_enable="YES" rpc_statd_enable="YES" nfs_client_enable="YES" nfs_server_enable="YES" Apologies for thinking this was an AutoFS problem - It's now clear to me that it's not! Do you have any thoughts on where the problem could be? Sorry, no idea. I've asked Rick Macklem, the NFS author and maintainer, to take a look. (In reply to Edward Tomasz Napierala from comment #3) Thank you, I appreciate it! Every time you mount(8) any file system on the NFS server, mountd reloads
the /etc/exports. This has two effects:
1 - Unless you are running mountd with the "-S" option, the file systems
will become unexported for a short period of time during the reload.
2 - If the new file system is mounted on top of the exported file system,
mountd will try to export that new file system.
--> NFS mounts can never be exported, so if the new file system is
an NFS client mount, the export will no longer work. (This has
been the case since 1985 and is in part the case because you
can't safely put a file handle inside a file handle.)
To fix #1, add "-S" to mountd_flags.
#2 just won't work and needs to be avoided. You can look at
/var/log/messages for entries related to export problems generated
by mountd.
I don't know amd-utils or autofs, but it may be that one of them uses
mount(8) and the other does not. FreeBSD's mount(8) always sends a
SIGHUP to mountd, which makes it reload /etc/exports.
Basically #1 and #2 only occurs because mountd reloads /etc/exports
and that happens when mountd receives a SIGHUP. It may be that amd-utils
doesn't send a SIGHUP to mountd?)
rick
(In reply to Rick Macklem from comment #5) Rick- You have solved my mystery. Giving mountd the -S argument worked! Thank you, it's certainly appreciated. |