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)
All Linux
unspecified Severity medium
: rc
: ---
Assigned To: Steve Dickson
Yongcheng Yang
Depends On:
  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:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
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):

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
[root@ ~]# grep ^[^#] /etc/nfsmount.conf
[ NFSMount_Global_Options ]
[root@ ~]# mount /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:  ""
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] = ""
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='
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying prog 100005 vers 3 prot UDP port 58089 on /mnt type nfs (rw)
[root@ ~]# nfsstat -m
/mnt from
 Flags:	rw,relatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=,mountvers=3,mountport=58089,mountproto=udp,local_lock=none,addr=

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

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

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

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

### "Defaultvers=4" /etc/nfsmount.conf works as expected ###
[root@ ~]# grep ^[^#] /etc/nfsmount.conf
[ NFSMount_Global_Options ]
[root@ ~]# mount /mnt/
[root@ ~]# get_mp_nfsvers /mnt/
[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.