Bug 1463064 - mount tries v3 even though the Defaultvers=2 set in /etc/nfsmount.conf
mount tries v3 even though the Defaultvers=2 set in /etc/nfsmount.conf
Status: NEW
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: nfs-utils (Show other bugs)
6.9
All Linux
unspecified Severity medium
: rc
: ---
Assigned To: Steve Dickson
Yongcheng Yang
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-06-19 23:33 EDT by Yongcheng Yang
Modified: 2017-06-20 04:46 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Yongcheng Yang 2017-06-19 23:33:19 EDT
Description of problem:
If setting Defaultvers=2 in /etc/nfsmount.conf, the mount is actually trying v3 not v2

Version-Release number of selected component (if applicable):
nfs-utils-1.2.3-75.el6

How reproducible:
100% easily

Steps to Reproduce:
1. Set "Defaultvers=2" in /etc/nfsmount.conf
2. Mount as default
3. Check the mounted nfs version


Actual results:
[root@ ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 6.9 (Santiago)
[root@ ~]# rpm -q nfs-utils
nfs-utils-1.2.3-75.el6.x86_64
[root@ ~]# grep ^[^#] /etc/nfsmount.conf
[ NFSMount_Global_Options ]
 Defaultvers=2
            ^^^
[root@ ~]# mount 127.0.0.1:/export_test /mnt -vvv
mount: fstab path: "/etc/fstab"
mount: mtab path:  "/etc/mtab"
mount: lock path:  "/etc/mtab~"
mount: temp path:  "/etc/mtab.tmp"
mount: UID:        0
mount: eUID:       0
mount: no type was given - I'll assume nfs because of the colon
mount: spec:  "127.0.0.1:/export_test"
mount: node:  "/mnt"
mount: types: "nfs"
mount: opts:  "(null)"
final mount options: '(null)'
mount: external mount: argv[0] = "/sbin/mount.nfs"
mount: external mount: argv[1] = "127.0.0.1:/export_test"
mount: external mount: argv[2] = "/mnt"
mount: external mount: argv[3] = "-v"
mount: external mount: argv[4] = "-o"
mount: external mount: argv[5] = "rw"
mount.nfs: timeout set for Mon Jun 19 23:15:21 2017
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 58089
127.0.0.1:/export_test on /mnt type nfs (rw)
[root@ ~]# nfsstat -m
/mnt from 127.0.0.1:/export_test
 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=58089,mountproto=udp,local_lock=none,addr=127.0.0.1

[root@ ~]# get_mp_nfsvers /mnt/
3
^^^
[root@ ~]# umount /mnt


Expected results:
Try mount v2 if setting "Defaultvers=2" in /etc/nfsmount.conf


### v2 specified mount works as expected ###
--------------------------------------------
[root@ ~]# mount 127.0.0.1:/export_test /mnt/ -o vers=2
[root@ ~]# get_mp_nfsvers /mnt/
2
[root@ ~]# umount /mnt/

### "Defaultvers=3" /etc/nfsmount.conf works as expected ###
------------------------------------------------------------
[root@ ~]# grep ^[^#] /etc/nfsmount.conf
[ NFSMount_Global_Options ]
 Defaultvers=3
[root@ ~]# mount 127.0.0.1:/export_test /mnt/
[root@ ~]# get_mp_nfsvers /mnt/
3
[root@ ~]# umount /mnt/

### "Defaultvers=4" /etc/nfsmount.conf works as expected ###
------------------------------------------------------------
[root@ ~]# grep ^[^#] /etc/nfsmount.conf
[ NFSMount_Global_Options ]
 Defaultvers=4
[root@ ~]# mount 127.0.0.1:/export_test /mnt/
[root@ ~]# get_mp_nfsvers /mnt/
4
[root@ ~]# umount /mnt/

Additional info:
It's maybe not a Severity issue as NFSv2 is not so popular IMHO.
Just file a bug to track it for now.

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