Bug 253625 - autofs fails to mount nfs4 when client and server are same machine
autofs fails to mount nfs4 when client and server are same machine
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: autofs (Show other bugs)
5.0
All Linux
medium Severity medium
: rc
: ---
Assigned To: Ian Kent
: Regression
Depends On:
Blocks: 426496
  Show dependency treegraph
 
Reported: 2007-08-20 18:03 EDT by Need Real Name
Modified: 2012-09-04 18:05 EDT (History)
2 users (show)

See Also:
Fixed In Version: RHBA-2008-0354
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-05-21 10:37:36 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch to check for "nosymlink" option at nfs mount time (549 bytes, patch)
2007-08-20 22:49 EDT, Ian Kent
no flags Details | Diff

  None (edit)
Description Need Real Name 2007-08-20 18:03:54 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):
autofs-5.0.1
nfs-utils-1.0.9
kernel-2.6.18-8.1.8

How reproducible:

Everytime

Steps to Reproduce:
1. export NFS4
2. make autofs map
3. try to access share
4. fails 
  
Actual results:


Expected results:


Additional info:
auto.home
  foo  -fstype=nfs4,rw,intr,nosuid,sec=sys  serverip:/users/foo
exports
   /exports/               ipaddress/24(rw,insecure,sync,fsid=0)
   /exports/users          ipaddress/24(rw,sync,nohide)

messages
   automount[4734]: mount(nfs): nfs: mount failure serverip:/users/foo on /home/foo
Comment 1 Ian Kent 2007-08-20 22:46:27 EDT
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
things.

Second, if you want to prevent bind mounts for individual
map entries, you can add the "port=nnnn" option to those
entries.

Ian
Comment 2 Ian Kent 2007-08-20 22:49:02 EDT
Created attachment 161943 [details]
Patch to check for "nosymlink" option at nfs mount time
Comment 3 Need Real Name 2007-08-21 15:28:32 EDT
I applied the patch to check for "nosymlink" to autofs-5.0.2 and modified the
auto.master file with the nosymlink option 
auto.master
    /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 
autofs.home
    foouser -fstype=nfs4,rw,nosuid,localroot=/exports
where localroot is the nfs4 fsid=0 exports directory
Comment 4 Ian Kent 2007-08-22 00:12:45 EDT
(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 
> auto.master
>     /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 
> autofs.home
>     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.

Ian
Comment 5 RHEL Product and Program Management 2007-08-22 04:39:50 EDT
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.
Comment 10 errata-xmlrpc 2008-05-21 10:37:36 EDT
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.

http://rhn.redhat.com/errata/RHBA-2008-0354.html

Note You need to log in before you can comment on or make changes to this bug.