Bug 711844 - cannot automount NFSv4 over IPv6
Summary: cannot automount NFSv4 over IPv6
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: autofs
Version: 16
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Ian Kent
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 711793 711956
Blocks: 753964
TreeView+ depends on / blocked
 
Reported: 2011-06-08 17:41 UTC by Jeff Bastian
Modified: 2012-08-27 22:57 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 753964 (view as bug list)
Environment:
Last Closed: 2012-08-27 22:57:12 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Patch - fix ipv6 name for lookup (2.39 KB, patch)
2011-06-09 07:40 UTC, Ian Kent
no flags Details | Diff
Patch - fix libtirpc ipv6 check (210.20 KB, patch)
2011-06-09 07:42 UTC, Ian Kent
no flags Details | Diff
Patch - fix ipv6 name lookup check (1.80 KB, patch)
2012-08-09 05:41 UTC, Ian Kent
no flags Details | Diff
Patch - fix ipv6 rpc calls (12.75 KB, patch)
2012-08-09 05:42 UTC, Ian Kent
no flags Details | Diff
Patch - fix ipv6 configure check (5.14 KB, patch)
2012-08-09 05:43 UTC, Ian Kent
no flags Details | Diff
Patch - fix nfs4 contacts portmap (1.35 KB, patch)
2012-08-09 05:57 UTC, Ian Kent
no flags Details | Diff
Patch - fix ipv6 proximity calculation (7.06 KB, patch)
2012-08-09 06:15 UTC, Ian Kent
no flags Details | Diff

Description Jeff Bastian 2011-06-08 17:41:56 UTC
Description of problem:
As part of the World IPv6 Test Day, I tried setting up automount to use an IPv6 address, but it's not working:

$ grep scratchv[46] /etc/auto.data
scratchv4       -fstype=nfs4 192.168.1.77:/scratch/
scratchv6       -fstype=nfs4 [2001:470:1f0f:46d:f2de:f1ff:fe15:6496]:/scratch/

$ ls /data/scratchv6
ls: cannot access /data/scratchv6: No such file or directory

$ ls /data/scratchv4
foo

Manually mounting the filesystem works fine, though:

$ sudo mount -t nfs4 [2001:470:1f0f:46d:f2de:f1ff:fe15:6496]:/scratch/ /mnt/tmp

$ ls /mnt/tmp
foo

The changelog indicates that autofs should support IPv6:

$ rpm -q --changelog autofs | grep -i ipv6
- dont fail on ipv6 address when adding host.
- update to provide ipv6 name and address support.
- update to provide ipv6 address parsing.


Version-Release number of selected component (if applicable):
autofs-5.0.5-35.fc15.i686

How reproducible:
every time

Steps to Reproduce:
1. set up NFSv4 server with IPv6
2. set up autofs client with a map entry pointing to the IPv6 NFSv4 server
3. try to automount a directory
  
Actual results:
ls: cannot access /data/scratchv6: No such file or directory

Expected results:
access the directory

Additional info:
I enabled debug logging in /etc/sysconfig/autofs and this is what I saw during the attempt to mount /data/scratchv6

Jun  8 12:40:32 corsair automount[2318]: handle_packet: type = 3
Jun  8 12:40:32 corsair automount[2318]: handle_packet_missing_indirect: token 15, name scratchv6, request pid 3263
Jun  8 12:40:32 corsair automount[2318]: attempting to mount entry /data/scratchv6
Jun  8 12:40:32 corsair automount[2318]: lookup_mount: lookup(file): looking up scratchv6
Jun  8 12:40:32 corsair automount[2318]: lookup_mount: lookup(file): scratchv6 -> -fstype=nfs4 [2001:470:1f0f:46d:f2de:f1ff:fe15:6496]:/scratch/
Jun  8 12:40:32 corsair automount[2318]: parse_mount: parse(sun): expanded entry: -fstype=nfs4 [2001:470:1f0f:46d:f2de:f1ff:fe15:6496]:/scratch/
Jun  8 12:40:32 corsair automount[2318]: parse_mount: parse(sun): gathered options: fstype=nfs4
Jun  8 12:40:32 corsair automount[2318]: parse_mount: parse(sun): dequote("[2001:470:1f0f:46d:f2de:f1ff:fe15:6496]:/scratch/") -> [2001:470:1f0f:46d:f2de:f1ff:fe15:6496]:/scratch/
Jun  8 12:40:32 corsair automount[2318]: parse_mount: parse(sun): core of entry: options=fstype=nfs4, loc=[2001:470:1f0f:46d:f2de:f1ff:fe15:6496]:/scratch/
Jun  8 12:40:32 corsair automount[2318]: sun_mount: parse(sun): mounting root /data, mountpoint scratchv6, what [2001:470:1f0f:46d:f2de:f1ff:fe15:6496]:/scratch/, fstype nfs4, options 
Jun  8 12:40:32 corsair automount[2318]: mount_mount: mount(nfs): root=/data name=scratchv6 what=[2001:470:1f0f:46d:f2de:f1ff:fe15:6496]:/scratch/, fstype=nfs4, options=
Jun  8 12:40:32 corsair automount[2318]: mount_mount: mount(nfs): nfs options="", nosymlink=0, ro=0
Jun  8 12:40:37 corsair automount[2318]: add_host_addrs: hostname lookup failed: Name or service not known
Jun  8 12:40:37 corsair automount[2318]: mount(nfs): no hosts available
Jun  8 12:40:37 corsair automount[2318]: st_readmap: state 1 path /data
Jun  8 12:40:37 corsair automount[2318]: dev_ioctl_send_fail: token = 15
Jun  8 12:40:37 corsair automount[2318]: failed to mount /data/scratchv6
Jun  8 12:40:37 corsair automount[2318]: re-reading map for /data
Jun  8 12:40:37 corsair automount[2318]: lookup_nss_read_map: reading map file /etc/auto.data
Jun  8 12:40:37 corsair automount[2318]: parse_init: parse(sun): init gathered global options: (null)
Jun  8 12:40:37 corsair automount[2318]: st_ready: st_ready(): state = 4 path /data

Comment 1 Ian Kent 2011-06-09 02:06:24 UTC
Right, I must have a mistake in what I'm using for the host
name, I'll investigate.

Comment 2 Ian Kent 2011-06-09 07:40:27 UTC
Created attachment 503836 [details]
Patch - fix ipv6 name for lookup

First pass patch to fix blunder in autofs IPv6 name lookup.

Comment 3 Ian Kent 2011-06-09 07:42:26 UTC
Created attachment 503837 [details]
Patch - fix libtirpc ipv6 check

First pass patch to correct the configure libtirpc IPv6
detection test code.

Comment 4 Ian Kent 2011-06-09 07:48:30 UTC
Once the above problems are fixed we find that the interface
ioctls never return IPv6 information.

What that means for autofs is that we can't detect when an
IPv6 address is a local interface or the address is directly
accessible via a local interface. Consequently bind mounts
can't be used for the localhost6 and all hosts appear to be
at the same proximity so there can't be a preference given
to host directly reachable via a local interface.

Comment 5 Ian Kent 2011-06-09 07:50:40 UTC
Oh .. and I logged bug 711956 because using libtirpc I found
the IPv6 functions autofs uses weren't actually included in
the library.

Comment 6 Fedora End Of Life 2012-08-07 20:08:39 UTC
This message is a notice that Fedora 15 is now at end of life. Fedora
has stopped maintaining and issuing updates for Fedora 15. It is
Fedora's policy to close all bug reports from releases that are no
longer maintained. At this time, all open bugs with a Fedora 'version'
of '15' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that
we were unable to fix it before Fedora 15 reached end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora, you are encouraged to click on
"Clone This Bug" (top right of this page) and open it against that
version of Fedora.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

The process we are following is described here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 7 Petr Pisar 2012-08-08 09:41:52 UTC
This is fixed in F17.
This still issue in F16.

Comment 8 Ian Kent 2012-08-09 05:41:11 UTC
Created attachment 603173 [details]
Patch - fix ipv6 name lookup check

Comment 9 Ian Kent 2012-08-09 05:42:47 UTC
Created attachment 603174 [details]
Patch - fix ipv6 rpc calls

Comment 10 Ian Kent 2012-08-09 05:43:57 UTC
Created attachment 603175 [details]
Patch - fix ipv6 configure check

Comment 11 Ian Kent 2012-08-09 05:57:28 UTC
Created attachment 603177 [details]
Patch - fix nfs4 contacts portmap

Comment 12 Ian Kent 2012-08-09 06:15:49 UTC
Created attachment 603178 [details]
Patch - fix ipv6 proximity calculation

Comment 13 Ian Kent 2012-08-09 08:46:08 UTC
(In reply to comment #5)
> Oh .. and I logged bug 711956 because using libtirpc I found
> the IPv6 functions autofs uses weren't actually included in
> the library.

I'm fairly sure I've applied the patches needed to resolve
this.

I'll request a push to testing.

Comment 14 Fedora Update System 2012-08-09 08:49:26 UTC
autofs-5.0.6-6.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/autofs-5.0.6-6.fc16

Comment 15 Fedora Update System 2012-08-09 23:07:58 UTC
Package autofs-5.0.6-6.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing autofs-5.0.6-6.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-11598/autofs-5.0.6-6.fc16
then log in and leave karma (feedback).

Comment 16 Petr Pisar 2012-08-10 07:10:39 UTC
It segfaults on F16. The nfs.englab.brq.redhat.com has one IPv4 and one IPv6 address:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fc5bc718700 (LWP 13939)]
0x00007fc5bb276d29 in __memcmp_sse4_1 () from /lib64/libc.so.6
(gdb) bt full
#0  0x00007fc5bb276d29 in __memcmp_sse4_1 () from /lib64/libc.so.6
No symbol table info available.
#1  0x00007fc5b9eb1fde in get_proximity (host_addr=<optimized out>)
    at replicated.c:177
        msk6_addr = <optimized out>
        addr_len = 16
        ifa = 0x7fc5ac003500
        addr = <optimized out>
        msk_addr = <optimized out>
        if_addr = <optimized out>
        if6_addr = <optimized out>
        mask6 = 0x0
        addr6 = <optimized out>
        hst_addr = 0x0
        hst6_addr = 0x7fc5ac000c68
        ha = 0
        buf = "\000\000\377\377\n\"\030\232", '\000' <repeats 40 times>, "P1q\274\305\177\000\000\002\000\000\000\000\000\000\000\060\f\000\254\305\177\000\000 \000\000\254\305\177\000\000`\v\000\254\305\177\000\000\000\000\000\000\000\000\000\000\005\000\000\000\000\000\000\000\310\065q\274\305\177\000\000\002\000\000\000\305\177\000\000\265\034\032\273\305\177\000"
        mask = <optimized out>
        ia6 = 0x0
---Type <return> to continue, or q <return> to quit---
        ret = <optimized out>
        this = 0x7fc5ac003728
        ha6 = 0x7fc5ac000c68
        ia = <optimized out>
#2  add_new_host (list=0x7fc5bc7135c8,
    host=0x7fc5ac000b20 "nfs.englab.brq.redhat.com", weight=0,
    host_addr=0x7fc5ac000c30, rr=0, options=0) at replicated.c:1003
        prx = <optimized out>
#3  0x00007fc5b9eb24d6 in add_host_addrs (list=0x7fc5bc7135c8,
    host=0x7fc5ac000b20 "nfs.englab.brq.redhat.com", weight=0, options=0)
    at replicated.c:1121
        hints = {ai_flags = 32, ai_family = 0, ai_socktype = 2,
          ai_protocol = 0, ai_addrlen = 0, ai_addr = 0x0, ai_canonname = 0x0,
          ai_next = 0x0}
        ni = 0x7fc5ac000c30
        this = 0x7fc5ac000c30
        n_ptr = 0x7fc5ac000a40 "nfs.englab.brq.redhat.com"
        name = 0x7fc500000000 <Address 0x7fc500000000 out of bounds>
        len = <optimized out>
        buf = "\000\000:", '\000' <repeats 124 times>
        rr = <optimized out>
        rr4 = <optimized out>
        rr6 = <optimized out>
        ret = <optimized out>
        __FUNCTION__ = "add_host_addrs"
#4  0x00007fc5b9eb2d3e in parse_location (logopt=<optimized out>,
    hosts=0x7fc5bc7135c8, list=<optimized out>, options=0) at replicated.c:1271
        path = 0x7fc5ac000b3a "/exports/scratch"
        next = 0x7fc5ac000b4a ""
        weight = <optimized out>
        str = 0x7fc5ac000b20 "nfs.englab.brq.redhat.com"
        p = <optimized out>
        delim = 0x7fc5ac000b39 ""
        empty = <optimized out>
#5  0x00007fc5b9eb072c in mount_mount (ap=0x7fc5bd27bff0,
    root=0x7fc5bd27c0d0 "/mnt/redhat", name=0x7fc5bc7146f0 "scratch",
    name_len=7,
    what=0x7fc5bc7146b0 "nfs.englab.brq.redhat.com:/exports/scratch",
    fstype=<optimized out>, options=0x7fc5bc714710 "rw,soft,intr", context=0x0)
    at mount_nfs.c:148
        fullpath = '\000' <repeats 2192 times>"\340, Dq\274\305\177\000\000\320Dq\274\305\177\000\000\bFq\274\305\177\000\000x@\r\272\305\177\000\000\a\000\000\000\000\000\000\000_u\026\273\305\177\000\000\000\000\000\000\000\000\000\000|@\r\272\305\177\000\000\000\000\000\000\000\000\000\000|@\r\272\305\177", '\000' <repeats 82 times>, " ", '\000' <repeats 67 times>, "\001", '\000' <repeats 11 times>, "\a", '\000' <repeats 15 times>"\377, \377\377\377\377\377\377\377", '\000---Type <return> to continue, or q <return> to quit---

Whole stack trace:
(gdb) bt
#0  0x00007fc5bb276d29 in __memcmp_sse4_1 () from /lib64/libc.so.6
#1  0x00007fc5b9eb1fde in get_proximity (host_addr=<optimized out>)
    at replicated.c:177
#2  add_new_host (list=0x7fc5bc7135c8, 
    host=0x7fc5ac000b20 "nfs.englab.brq.redhat.com", weight=0, 
    host_addr=0x7fc5ac000c30, rr=0, options=0) at replicated.c:1003
#3  0x00007fc5b9eb24d6 in add_host_addrs (list=0x7fc5bc7135c8, 
    host=0x7fc5ac000b20 "nfs.englab.brq.redhat.com", weight=0, options=0)
    at replicated.c:1121
#4  0x00007fc5b9eb2d3e in parse_location (logopt=<optimized out>, 
    hosts=0x7fc5bc7135c8, list=<optimized out>, options=0) at replicated.c:1271
#5  0x00007fc5b9eb072c in mount_mount (ap=0x7fc5bd27bff0, 
    root=0x7fc5bd27c0d0 "/mnt/redhat", name=0x7fc5bc7146f0 "scratch", 
    name_len=7, 
    what=0x7fc5bc7146b0 "nfs.englab.brq.redhat.com:/exports/scratch", 
    fstype=<optimized out>, options=0x7fc5bc714710 "rw,soft,intr", context=0x0)
    at mount_nfs.c:148
#6  0x00007fc5ba0c098d in sun_mount (ap=0x7fc5bd27bff0, 
    root=0x7fc5bd27c0d0 "/mnt/redhat", name=0x7fc5bc715a40 "scratch", 
    namelen=7, 
    loc=0x7fc5ac000ae0 "nfs.englab.brq.redhat.com:/exports/scratch", 
    loclen=42, options=0x7fc5bc714710 "rw,soft,intr", ctxt=0x7fc5b4001700)
    at parse_sun.c:699
---Type <return> to continue, or q <return> to quit---
#7  0x00007fc5ba0c38e2 in parse_mount (ap=0x7fc5bd27bff0, 
    name=0x7fc5bc715a40 "scratch", name_len=7, 
    mapent=0x7fc5bc714a40 "-rw,soft,intr   nfs.englab.brq.redhat.com:/exports/scratch", context=<optimized out>) at parse_sun.c:1813
#8  0x00007fc5ba2e5a63 in lookup_mount (ap=0x7fc5bd27bff0, 
    name=<optimized out>, name_len=<optimized out>, context=0x7fc5b4001070)
    at lookup_file.c:1074
#9  0x00007fc5bc763205 in lookup_name_file_source_instance (ap=0x7fc5bd27bff0, 
    map=0x7fc5bd27c0f0, name=0x7fc5bc715e90 "scratch", name_len=7)
    at lookup.c:718
#10 0x00007fc5bc763a0e in lookup_nss_mount (ap=0x7fc5bd27bff0, source=0x0, 
    name=0x7fc5bc715e90 "scratch", name_len=7) at lookup.c:909
#11 0x00007fc5bc75ad7b in do_mount_indirect (arg=0x7fc5b4002e70)
    at indirect.c:777
#12 0x00007fc5bc315d90 in start_thread () from /lib64/libpthread.so.0
#13 0x00007fc5bb21067d in clone () from /lib64/libc.so.6

My  glibc is glibc-2.14.90-24.fc16.8.x86_64.

Comment 17 Ian Kent 2012-08-10 08:22:42 UTC
(In reply to comment #16)
> It segfaults on F16. The nfs.englab.brq.redhat.com has one IPv4 and one IPv6
> address:

There is a mistake in the conversion to use getifaddrs(3).
It is a new patch so I'm not surprized there's a mistake in
it, sorry about that.

I incorrectly dropped a check in cases thinking it wasn't
needed. Too much focus on what I wanted to do rather than
what I was doing.

Let me fix it we'll have another go at it.

Comment 18 Fedora Update System 2012-08-10 08:44:25 UTC
autofs-5.0.6-7.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/autofs-5.0.6-7.fc16

Comment 19 Fedora Update System 2012-08-10 22:31:20 UTC
Package autofs-5.0.6-7.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing autofs-5.0.6-7.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-11719/autofs-5.0.6-7.fc16
then log in and leave karma (feedback).

Comment 20 Fedora Update System 2012-08-27 22:57:12 UTC
autofs-5.0.6-7.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.


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