Red Hat Bugzilla – Bug 253625
autofs fails to mount nfs4 when client and server are same machine
Last modified: 2012-09-04 18:05:05 EDT
Description of problem:
autofs fails to mount nfs4 when client and server are same machine.
We are using NFSv4 and are automounting /home and various data directories.
Automount and NFSv4 works great except when trying to mount a share on a client
that is also the server exporting the share (loopback). Then the mount fails.
Mounting the share at the command line with the same mount options works.
I belive autofs is tring to use bind to mount the local share but failing
because the local path and the exported path are different.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. export NFS4
2. make autofs map
3. try to access share
foo -fstype=nfs4,rw,intr,nosuid,sec=sys serverip:/users/foo
automount: mount(nfs): nfs: mount failure serverip:/users/foo on /home/foo
This was discussed recently on the upstream mailing list.
In summary there are two possibilities.
First, you should be able to use the "nosymlink" option in
the master map entry to tell autofs not to attempt bind
mounts for entries the map but, due to an omission on my
part, the option isn't checked at mount time so the patch
below is needed. This hasn't been committed upstream yet
because I didn't get any feedback and so I worked on other
Second, if you want to prevent bind mounts for individual
map entries, you can add the "port=nnnn" option to those
Created attachment 161943 [details]
Patch to check for "nosymlink" option at nfs mount time
I applied the patch to check for "nosymlink" to autofs-5.0.2 and modified the
auto.master file with the nosymlink option
/home file:/etc/auto.home nosymlink
This seems to have fixed the problem with nfs4 local mounting.
Question! Is this a long term fix. Or might there be a patch to allow using bind
with NFSv4 mapping.
Somethiing along the lines of
where localroot is the nfs4 fsid=0 exports directory
(In reply to comment #3)
> I applied the patch to check for "nosymlink" to autofs-5.0.2 and modified the
> auto.master file with the nosymlink option
> /home file:/etc/auto.home nosymlink
> This seems to have fixed the problem with nfs4 local mounting.
OK, that's good to know.
> Question! Is this a long term fix. Or might there be a patch to allow using bind
> with NFSv4 mapping.
Well it will at least be one option as I need to add
this for those people that have used it in the past in
previous versions. The name of the option is a little
misleading as well. Also I need to add it to the man
pages, since it's remained undocumented for a long time.
> Somethiing along the lines of
> foouser -fstype=nfs4,rw,nosuid,localroot=/exports
> where localroot is the nfs4 fsid=0 exports directory
It's risky to add autofs specific options like this in
case they clash with mount(8) options. So I'm not really
sure about what might happen here as time passes.
This bugzilla has Keywords: Regression.
Since no regressions are allowed between releases,
it is also being proposed as a blocker for this release.
Please resolve ASAP.
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.