Bug 1447849

Summary: mount.nfs4 falls back to version 3 when mounting the exports with fsid=0 option
Product: Red Hat Enterprise Linux 7 Reporter: Yongcheng Yang <yoyang>
Component: nfs-utilsAssignee: Steve Dickson <steved>
Status: CLOSED ERRATA QA Contact: Yongcheng Yang <yoyang>
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.4CC: chunwang, eguan, jiyin, steved, yoyang
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: nfs-utils-1.3.0-0.44.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1457921 (view as bug list) Environment:
Last Closed: 2017-08-01 19:50:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1456511, 1457921    

Description Yongcheng Yang 2017-05-04 03:49:55 UTC
Description of problem:

For the NFS exports identified with the fsid=0 option which means it's the root of all exported filesystem, previously (rhel-7.3) we can only mount it with command "mount -t nfs4 server:/ /mnt/home", while command "mount -t nfs4 server:/home /mnt/home" gets failed.  The difference being "server:/home" and "server:/".

But now with the latest nfs-utils, command "mount -t nfs4 server:/home /mnt/home" successes and it actually mounts with NFS version 3.


Version-Release number of selected component (if applicable):
Start from nfs-utils-1.3.0-0.35.el7 until latest version (1.3.0-0.41.el7)
(Haven't test version 1.3.0-0.34.el7 as cannot download it for now)

How reproducible:
100% easily

Steps to Reproduce:
1. echo "/home *(rw,fsid=0,sync)" > /etc/exports
                    ^^^^^^
2. systemctl restart nfs
3. mount -t nfs4 127.0.0.1:/home /mnt/test
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ should be failed

Actual results:
[root@hp-dl360g9-14 ~]# cat /etc/exports
/home *(rw,fsid=0,sync)
[root@hp-dl360g9-14 ~]# systemctl restart nfs
[root@hp-dl360g9-14 ~]# exportfs -v
/home         	<world>(rw,sync,wdelay,hide,no_subtree_check,fsid=0,sec=sys,secure,root_squash,no_all_squash)
[root@hp-dl360g9-14 ~]# mount -o vers=4 127.0.0.1:/home/ /mnt/mnt_test/
[root@hp-dl360g9-14 ~]# echo $?
0
[root@hp-dl360g9-14 ~]# nfsstat -m
/mnt/mnt_test from 127.0.0.1:/home/
 Flags:	rw,relatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=127.0.0.1,mountvers=3,mountport=20048,mountproto=udp,local_lock=none,addr=127.0.0.1

[root@hp-dl360g9-14 ~]# umount /mnt/mnt_test/
[root@hp-dl360g9-14 ~]# mount -t nfs4 127.0.0.1:/home/ /mnt/mnt_test/ -vvv
mount.nfs4: timeout set for Wed May  3 22:54:56 2017
mount.nfs4: trying text-based options 'vers=4.1,addr=127.0.0.1,clientaddr=127.0.0.1'
mount.nfs4: mount(2): No such file or directory
mount.nfs4: trying text-based options 'addr=127.0.0.1'
mount.nfs4: prog 100003, trying vers=3, prot=6
mount.nfs4: trying 127.0.0.1 prog 100003 vers 3 prot TCP port 2049
mount.nfs4: prog 100005, trying vers=3, prot=17
mount.nfs4: trying 127.0.0.1 prog 100005 vers 3 prot UDP port 20048
[root@hp-dl360g9-14 ~]# umount /mnt/mnt_test/
[root@hp-dl360g9-14 ~]#
[root@hp-dl360g9-14 ~]# mount -o vers=4 127.0.0.1:/home/ /mnt/mnt_test/ -vvv
mount.nfs: timeout set for Wed May  3 22:58:06 2017
mount.nfs: trying text-based options 'vers=4,addr=127.0.0.1,clientaddr=127.0.0.1'
mount.nfs: mount(2): No such file or directory
mount.nfs: trying text-based options 'addr=127.0.0.1'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 127.0.0.1 prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying 127.0.0.1 prog 100005 vers 3 prot UDP port 20048
[root@hp-dl360g9-14 ~]# umount /mnt/mnt_test/
[root@hp-dl360g9-14 ~]# rpm -q nfs-utils
nfs-utils-1.3.0-0.35.el7.x86_64
[root@hp-dl360g9-14 ~]# 


Expected results:
### downgrade nfs-utils to 1.3.0-0.33.el7 ###
[root@hp-dl360g9-14 ~]# rpm -q nfs-utils
nfs-utils-1.3.0-0.33.el7.x86_64
[root@hp-dl360g9-14 ~]# exportfs -v
/home         	<world>(rw,wdelay,root_squash,no_subtree_check,fsid=0,sec=sys,rw,secure,root_squash,no_all_squash)
[root@hp-dl360g9-14 ~]# mount -t nfs4 127.0.0.1:/home/ /mnt/mnt_test/ -vvv
mount.nfs4: timeout set for Wed May  3 22:57:04 2017
mount.nfs4: trying text-based options 'addr=127.0.0.1,clientaddr=127.0.0.1'
mount.nfs4: mount(2): No such file or directory
mount.nfs4: mounting 127.0.0.1:/home/ failed, reason given by server: No such file or directory
[root@hp-dl360g9-14 ~]# mount -o vers=4 127.0.0.1:/home/ /mnt/mnt_test/ -vvv
mount.nfs: timeout set for Wed May  3 22:57:24 2017
mount.nfs: trying text-based options 'vers=4,addr=127.0.0.1,clientaddr=127.0.0.1'
mount.nfs: mount(2): No such file or directory
mount.nfs: mounting 127.0.0.1:/home/ failed, reason given by server: No such file or directory
[root@hp-dl360g9-14 ~]# 


Additional info:
Maybe introduced by Bug 1375259 (same as Bug 1404617)

Comment 9 Yongcheng Yang 2017-06-05 02:30:51 UTC
Moving to VERIFIED according to test logs of Comment #8

Comment 10 errata-xmlrpc 2017-08-01 19:50:23 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:2233