Bug 253625 - autofs fails to mount nfs4 when client and server are same machine
Summary: autofs fails to mount nfs4 when client and server are same machine
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: autofs
Version: 5.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Ian Kent
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 426496
TreeView+ depends on / blocked
 
Reported: 2007-08-20 22:03 UTC by Need Real Name
Modified: 2012-09-04 22:05 UTC (History)
2 users (show)

Fixed In Version: RHBA-2008-0354
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-05-21 14:37:36 UTC
Target Upstream Version:
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2008:0354 0 normal SHIPPED_LIVE autofs bug fix and enhancement update 2008-05-20 12:52:25 UTC

Description Need Real Name 2007-08-20 22:03:54 UTC
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-21 02:46:27 UTC
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-21 02:49:02 UTC
Created attachment 161943 [details]
Patch to check for "nosymlink" option at nfs mount time

Comment 3 Need Real Name 2007-08-21 19:28:32 UTC
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 04:12:45 UTC
(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 Program Management 2007-08-22 08:39:50 UTC
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 14:37:36 UTC
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.