Bug 738861

Summary: nfs not served to ipv6 only clients
Product: [openSUSE] openSUSE 12.1 Reporter: Forgotten User cI3FYhfYTs <forgotten_cI3FYhfYTs>
Component: BasesystemAssignee: Neil Brown <nfbrown>
Status: RESOLVED INVALID QA Contact: E-mail List <qa-bugs>
Severity: Major    
Priority: P5 - None    
Version: Final   
Target Milestone: ---   
Hardware: x86-64   
OS: SUSE Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: strace -v -fF -s 65536 of automount -vvv -d

Description Forgotten User cI3FYhfYTs 2011-12-29 10:11:38 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:12.0a1) Gecko/20111226 Firefox/12.0a1

Here's my automounter setup:

/etc/auto.master:
/home   /etc/auto.home

/etc/auto.home:
*       -rw,fstype=nfs4 bridge.fresse.org:/home/&

(automounter is started with -vvv)


Reproducible: Always

Actual Results:  
Dec 29 09:53:10 kegel automount[1776]: Starting automounter version 5.0.6, master map auto.master
Dec 29 09:53:10 kegel automount[1776]: using kernel protocol version 5.02
Dec 29 09:53:10 kegel automount[1776]: lookup_nss_read_master: reading master files auto.master
Dec 29 09:53:10 kegel automount[1776]: parse_init: parse(sun): init gathered global options: (null)
Dec 29 09:53:10 kegel automount[1776]: lookup_read_master: lookup(file): read entry /home
Dec 29 09:53:10 kegel automount[1776]: master_do_mount: mounting /home
Dec 29 09:53:10 kegel automount[1776]: automount_path_to_fifo: fifo name /var/run/autofs.fifo-home
Dec 29 09:53:10 kegel automount[1776]: lookup_nss_read_map: reading map file /etc/auto.home
Dec 29 09:53:10 kegel automount[1776]: parse_init: parse(sun): init gathered global options: (null)
Dec 29 09:53:10 kegel automount[1776]: mounted indirect on /home with timeout 600, freq 150 seconds
Dec 29 09:53:10 kegel automount[1776]: st_ready: st_ready(): state = 0 path /home
Dec 29 09:53:10 kegel automount[1776]: ghosting enabled
Dec 29 09:53:17 kegel automount[1776]: handle_packet: type = 3
Dec 29 09:53:17 kegel automount[1776]: handle_packet_missing_indirect: token 9, name src, request pid 1784
Dec 29 09:53:17 kegel automount[1776]: attempting to mount entry /home/src
Dec 29 09:53:17 kegel automount[1776]: lookup_mount: lookup(file): looking up src
Dec 29 09:53:17 kegel automount[1776]: lookup_mount: lookup(file): src -> -rw,fstype=nfs4#011bridge.fresse.org:/home/&
Dec 29 09:53:17 kegel automount[1776]: parse_mount: parse(sun): expanded entry: -rw,fstype=nfs4#011bridge.fresse.org:/home/src
Dec 29 09:53:17 kegel automount[1776]: parse_mount: parse(sun): gathered options: rw,fstype=nfs4
Dec 29 09:53:17 kegel automount[1776]: parse_mount: parse(sun): dequote("bridge.fresse.org:/home/src") -> bridge.fresse.org:/home/src
Dec 29 09:53:17 kegel automount[1776]: parse_mount: parse(sun): core of entry: options=rw,fstype=nfs4, loc=bridge.fresse.org:/home/src
Dec 29 09:53:17 kegel automount[1776]: sun_mount: parse(sun): mounting root /home, mountpoint src, what bridge.fresse.org:/home/src, fstype nfs4, options rw
Dec 29 09:53:17 kegel automount[1776]: mount_mount: mount(nfs): root=/home name=src what=bridge.fresse.org:/home/src, fstype=nfs4, options=rw
Dec 29 09:53:17 kegel automount[1776]: mount_mount: mount(nfs): nfs options="rw", nobind=0, nosymlink=0, ro=0
Dec 29 09:53:17 kegel automount[1776]: mount(nfs): no hosts available
Dec 29 09:53:17 kegel automount[1776]: dev_ioctl_send_fail: token = 9
Dec 29 09:53:17 kegel automount[1776]: failed to mount /home/src
Dec 29 09:53:17 kegel automount[1776]: handle_packet: type = 3
Dec 29 09:53:17 kegel automount[1776]: handle_packet_missing_indirect: token 10, name src, request pid 1784
Dec 29 09:53:17 kegel automount[1776]: attempting to mount entry /home/src
Dec 29 09:53:17 kegel automount[1776]: lookup_mount: lookup(file): looking up src
Dec 29 09:53:17 kegel automount[1776]: dev_ioctl_send_fail: token = 10
Dec 29 09:53:17 kegel automount[1776]: failed to mount /home/src


Expected Results:  
The mount should just have succeeded as it does in oS 11.3 and 11.4

I think the underlying problem is that mount.nfs4 does not resolve ipv6 addresses, here's the corresponding fragments from strace:

1914  socket(PF_INET6, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 3
1914  connect(3, {sa_family=AF_INET6, sin6_port=htons(53), inet_pton(AF_INET6, "2a01:198:5b7:200::1", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 28) = 0
1914  gettimeofday({1325153054, 281751}, NULL) = 0
1914  poll([{fd=3, events=POLLOUT}], 1, 0) = 1 ([{fd=3, revents=POLLOUT}])
1914  sendto(3, "w_\1\0\0\1\0\0\0\0\0\0\6bridge\6fresse\3org\0\0\1\0\1", 35, MSG_NOSIGNAL, NULL, 0) = 35
1914  poll([{fd=3, events=POLLIN}], 1, 5000) = 1 ([{fd=3, revents=POLLIN}])
1914  ioctl(3, FIONREAD, [86])          = 0
1914  recvfrom(3, "w_\201\200\0\1\0\0\0\1\0\0\6bridge\6fresse\3org\0\0\1\0\1\300\23\0\6\0\1\0\0\1`\0'\3ns5\300\23\nhostmaster\300\23w\336\364\215\0\0S\230\0\0\16\20\0\32^\0\0\0\7\10", 1024, 0, {sa_family=AF_INET6, sin6_port=htons(53), inet_pton(AF_INET6, "2a01:198:5b7:200::1", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, [28]) = 86
1914  close(3)                          = 0
1914  socket(PF_INET6, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 3
1914  connect(3, {sa_family=AF_INET6, sin6_port=htons(53), inet_pton(AF_INET6, "2a01:198:5b7:200::1", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 28) = 0
1914  gettimeofday({1325153054, 283003}, NULL) = 0
1914  poll([{fd=3, events=POLLOUT}], 1, 0) = 1 ([{fd=3, revents=POLLOUT}])
1914  sendto(3, "\313\335\1\0\0\1\0\0\0\0\0\0\6bridge\6fresse\3org\0\0\1\0\1", 35, MSG_NOSIGNAL, NULL, 0) = 35
1914  poll([{fd=3, events=POLLIN}], 1, 5000) = 1 ([{fd=3, revents=POLLIN}])
1914  ioctl(3, FIONREAD, [86])          = 0
1914  recvfrom(3, "\313\335\201\200\0\1\0\0\0\1\0\0\6bridge\6fresse\3org\0\0\1\0\1\300\23\0\6\0\1\0\0\1`\0'\3ns5\300\23\nhostmaster\300\23w\336\364\215\0\0S\230\0\0\16\20\0\32^\0\0\0\7\10", 1024, 0, {sa_family=AF_INET6, sin6_port=htons(53), inet_pton(AF_INET6, "2a01:198:5b7:200::1", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, [28]) = 86
1914  close(3)                          = 0
1914  write(2, "mount.nfs4: Failed to resolve server bridge.fresse.org: Name or service not known\n", 82) = 82
1914  exit_group(32)                    = ?

As you can clearly see, it asks for bridge.fresse.org A records TWICE, instead of trying to ask for A and AAAA.
Comment 1 Kun Kun Zhang 2012-03-09 07:24:18 UTC
Long time no response.So closed.Feel free to reopen it.Thanks.
Comment 2 Forgotten User cI3FYhfYTs 2012-03-09 07:39:43 UTC
As the issue has not been resolved yet, nor have there been any questions asked, I'm reopening it.
Comment 3 Neil Brown 2012-08-28 11:34:45 UTC
Hi,
It seems this never fot assign, sorry about that.

As you say - 2 'A' lookups, no 'AAAA' lookups.  Very strange.
I won't be able to look into this this week, but I'll try to find out what it going on next week.
Comment 4 Neil Brown 2012-09-17 02:41:00 UTC
I've experimented on my machine (Which is 12.1 plus some updates from Tumbleweed) and it works perfectly.

An 'strace' shows that two A and AAAA requests are sent concurrently.  i.e it sends both requests and then wait for the replies.
Your strace doesn't show any AAAA request being sent - just the A.

So either there is a configuration problem on your machine, or maybe I
have a newer library than you.

Do you have anything interesting in "/etc/resolv.conf" or /etc/host.conf or
/etc/gai.conf?

What version of glibc do you have (rpm -q glibc) - I have glibc-2.14.1-14.27.1.x86_64
Comment 5 Forgotten User cI3FYhfYTs 2012-09-17 07:43:48 UTC
/etc/resolve.conf
search fresse.org.
nameserver 2001:470:9141:200::1
nameserver 2a01:198:5b7:200::1

/etc/gai.conf
scopev4 ::ffff:10.0.0.0/104 14
scopev4 ::ffff:172.16.0.0/108 14
scopev4 ::ffff:192.168.0.0/112 14

/etc/host.conf
order hosts, bind
multi on

rpm -q glibc
glibc-2.14.1-14.27.1.x86_64

I've just rechecked with tshark, mount.nfs4 definitely sends two A requests, and also still prints:
mount.nfs4: Failed to resolve server bridge.fresse.org: Name or
service not known
Comment 6 Neil Brown 2012-09-17 09:46:11 UTC
Hmm.. nothing odd there.
I only had IPv4 addresses in my resolv.conf but I changed them to IPv6 address and it still works for me.

How about /etc/nfsmount.conf  - it's a bit of a long shot though.

Also could you please attach a complete 'strace' of a failing mount attempt?  I can then compare it to mine and see if there are any hints there.
Comment 7 Forgotten User cI3FYhfYTs 2012-09-17 12:38:54 UTC
Created attachment 505974 [details]
strace -v -fF -s 65536 of automount -vvv -d
Comment 8 Forgotten User cI3FYhfYTs 2012-09-17 12:39:41 UTC
root@kegel:~ # grep -v "^#" /etc/nfsmount.conf        
[ NFSMount_Global_Options ]
Nfsvers=4
Defaultproto=udp
Proto=udp

The strace of automount -vvv -d is in the attachment.
Comment 9 Forgotten User cI3FYhfYTs 2012-09-17 12:42:22 UTC
Don't know if it's worth mentioning, but I installed a systemd from fcrozat's repository.  I'm saying this because I'm starting to see the bug again where the NIC is going down willy-nilly out of the blue.

Before I attached the strace to the automount process, the NIC disappeared, so I had to set that one up again.  And after I detached the strace the NIC went down again.  Oh, and nscd went down too.
Comment 10 Neil Brown 2012-09-18 01:45:16 UTC
Bingo.  Sometimes long shots pay off.

"udp" means "udp on IPv4".

To use udp on IPv6 you need "udp6" as the protocol.

I don't think there is a way to say "use UDP, over either IPv4 or IPv6".
I'll ask...
Comment 11 Forgotten User cI3FYhfYTs 2012-09-18 07:22:38 UTC
It's an IPv6 only network anyway, so just using udp/ipv6 is fine.

The AAAA lookup now does work, but I'm stuck in the next step:

Sep 18 07:17:54 kegel automount[3401]: attempting to mount entry /home/src
Sep 18 07:17:54 kegel automount[3401]: lookup_mount: lookup(file): looking up src
Sep 18 07:17:54 kegel automount[3401]: lookup_mount: lookup(file): src -> -rw,fstype=nfs4#011bridge.fresse.org:/home/&
Sep 18 07:17:54 kegel automount[3401]: parse_mount: parse(sun): expanded entry: -rw,fstype=nfs4#011bridge.fresse.org:/home/src
Sep 18 07:17:54 kegel automount[3401]: parse_mount: parse(sun): gathered options: rw,fstype=nfs4
Sep 18 07:17:54 kegel automount[3401]: parse_mount: parse(sun): dequote("bridge.fresse.org:/home/src") -> bridge.fresse.org:/home/src
Sep 18 07:17:54 kegel automount[3401]: parse_mount: parse(sun): core of entry: options=rw,fstype=nfs4, loc=bridge.fresse.org:/home/src
Sep 18 07:17:54 kegel automount[3401]: sun_mount: parse(sun): mounting root /home, mountpoint src, what bridge.fresse.org:/home/src, fstype nfs4, options rw
Sep 18 07:17:54 kegel automount[3401]: mount_mount: mount(nfs): root=/home name=src what=bridge.fresse.org:/home/src, fstype=nfs4, options=rw
Sep 18 07:17:54 kegel automount[3401]: mount_mount: mount(nfs): nfs options="rw", nobind=0, nosymlink=0, ro=0
Sep 18 07:17:54 kegel automount[3401]: mount(nfs): no hosts available
Sep 18 07:17:54 kegel automount[3401]: dev_ioctl_send_fail: token = 7
Sep 18 07:17:54 kegel automount[3401]: failed to mount /home/src

But that might as well be a different bug.
Comment 12 Neil Brown 2012-09-18 08:00:41 UTC
Yes, I think that is a diffferent bug - some automount problem by the look of it.
I think it is best if you open a new bugzilla and I know very little about automount.
We'll call this one 'fixed' as we now know that mount.nfs is working as designed (even if I might think the design is imperfect).  I've opened a discussion on linux-nfs@vger.kernel.org or see about clarifying the documentation.