Bug 1363737

Summary: man mount.nfs incorrectly mentions the default mount version as nfs version 3 or 2
Product: Red Hat Enterprise Linux 7 Reporter: Ameya Sathe <asathe>
Component: nfs-utilsAssignee: Steve Dickson <steved>
Status: CLOSED ERRATA QA Contact: Yongcheng Yang <yoyang>
Severity: high Docs Contact:
Priority: high    
Version: 7.2CC: eguan
Target Milestone: rc   
Target Release: 7.3   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: nfs-utils-1.3.0-0.32.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-04 05:04:20 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:

Description Ameya Sathe 2016-08-03 13:03:43 UTC
Description of problem:
Quoting from 'man mount.nfs':
"mount.nfs is used to mount NFS file systems versions 3 or 2"

But, 
mount.nfs  nfsserver.example.com:/nfsshare  /abc  -v 
gives the following output

mount.nfs  nfsserver.example.com:/nfsshare  /abc -v
mount.nfs: timeout set for Wed Aug  3 12:43:57 2016
mount.nfs: trying text-based options 'vers=4,addr=10.7.241.211,clientaddr=10.27.119.29'
mount.nfs: mount(2): Permission denied
mount.nfs: access denied by server while mounting nfsserver.example.com:/nfsshare

Version-Release number of selected component (if applicable):

nfs-utils-1.3.0-0.21.el7_2.1.x86_64

How reproducible:


Steps to Reproduce:
1. On  Red Hat Enterprise Linux Server release 7.2 (Maipo), install nfs-utils-1.3.0-0.21.el7_2.1.x86_64 and tag it as your NFS server.


2.  Configure a nfs share with any export version

 cat  /etc/exports.d/myshare.exports
/myshare 10.65.202.216/24(rw)

3. On  Red Hat Enterprise Linux Server release 7.2 (Maipo), install nfs-utils-1.3.0-0.21.el7_2.1.x86_64 and tag it as your NFS client.

4.  Execute the mount.nfs command in verbose mode on the NFS client to mount the NFS share.

5.  The mount.nfs command uses nfs version 4 to mount the nfs share, instead of using version 2 or 3 as specified in the manual page of mount.nfs

Actual results:

mount.nfs  10.65.202.237:/myshare /mnt/nfsexport/ -v
mount.nfs: timeout set for Wed Aug  3 18:22:29 2016
mount.nfs: trying text-based options 'vers=4,addr=10.65.202.237,clientaddr=10.65.202.216'
10.65.202.237:/myshare on /mnt/nfsexport type nfs


Expected results:

mount.nfs  10.65.202.237:/myshare /mnt/nfsexport/ -v
mount.nfs: timeout set for Wed Aug  3 18:22:29 2016
mount.nfs: trying text-based options 'vers=3,addr=10.65.202.237,clientaddr=10.65.202.216'
10.65.202.237:/myshare on /mnt/nfsexport type nfs

Additional info:

If the NFS server is not supporting the version 4 but only version 3; then the mount.nfs gives following error:
mount.nfs: timeout set for Wed Aug  3 13:00:28 2016
mount.nfs: trying text-based options 'vers=4,addr=10.65.202.237,clientaddr=10.65.202.216'
mount.nfs: mount(2): Permission denied
mount.nfs: access denied by server while mounting 10.65.202.237:/myshare

Comment 1 Steve Dickson 2016-08-03 14:20:26 UTC
(In reply to Ameya Sathe from comment #0)
> Description of problem:
> Quoting from 'man mount.nfs':
> "mount.nfs is used to mount NFS file systems versions 3 or 2"
>

I don't see the problem here.... because the man page also says 
"mount.nfs4 is used for mounting NFSv4 file system" which
is the case.

Comment 3 Yongcheng Yang 2016-08-04 09:42:20 UTC
(In reply to Ameya Sathe from comment #0)
> Description of problem:
> Quoting from 'man mount.nfs':
> "mount.nfs is used to mount NFS file systems versions 3 or 2"
> 
> But, 
> mount.nfs  nfsserver.example.com:/nfsshare  /abc  -v 
> gives the following output
> 
> mount.nfs  nfsserver.example.com:/nfsshare  /abc -v
> mount.nfs: timeout set for Wed Aug  3 12:43:57 2016
> mount.nfs: trying text-based options
> 'vers=4,addr=10.7.241.211,clientaddr=10.27.119.29'
> mount.nfs: mount(2): Permission denied
> mount.nfs: access denied by server while mounting
> nfsserver.example.com:/nfsshare
> 

Maybe we need to import the upstream patch:

commit d1f6583a5ff32711a1da1d4a13a29a5700f63504
Author: Ben Hutchings <ben.uk>
Date:   Thu Apr 2 11:43:33 2015 -0400

    mount.nfs.man, nfs.man: Update distinction between fstypes
    
    From: Ben Hutchings <ben.uk>
    
    this is a resync of the man page updates in the Debian
    package with mainline nfs-utils.
    
    Acked-By: J. Bruce Fields <bfields>
    Signed-off-by: Steve Dickson <steved>

And then the mount.nfs(8) will look like:
"Under Linux 2.6.32 and later kernel versions, mount.nfs can mount all NFS file system versions.  Under earlier Linux kernel versions, mount.nfs4 must be used for mounting NFSv4 file systems while mount.nfs must be used for NFSv3 and v2."

Comment 6 Yongcheng Yang 2016-08-08 08:01:58 UTC
Have checked the man page is updated as expected.
Move this bug on to VERIFIED.

[root@ibm-x3250m4-07 ~]# rpm -Uvh nfs-utils-1.3.0-0.32.el7.x86_64.rpm 
Preparing...                          ################################# [100%]
Updating / installing...
   1:nfs-utils-1:1.3.0-0.32.el7       ################################# [ 50%]
Cleaning up / removing...
   2:nfs-utils-1:1.3.0-0.31.el7       ################################# [100%]
[root@ibm-x3250m4-07 ~]# rpm -q nfs-utils
nfs-utils-1.3.0-0.32.el7.x86_64
[root@ibm-x3250m4-07 ~]# man mount.nfs | col -b 
MOUNT.NFS(8)						    System Manager's Manual						  MOUNT.NFS(8)



NAME
       mount.nfs, mount.nfs4 - mount a Network File System

SYNOPSIS
       mount.nfs remotetarget dir [-rvVwfnsh ] [-o options]

DESCRIPTION
       mount.nfs is a part of nfs(5) utilities package, which provides NFS client functionality.

       mount.nfs  is  meant to be used by the mount(8) command for mounting NFS shares. This subcommand, however, can also be used as a stand‐
       alone command with limited functionality.

       remotetarget is a server share usually in the form of servername:/path/to/share.	 dir is the directory on which the file system	is  to
       be mounted.

       Under  Linux  2.6.32 and later kernel versions, mount.nfs can mount all NFS file system versions.  Under earlier Linux kernel versions,
       mount.nfs4 must be used for mounting NFSv4 file systems while mount.nfs must be used for NFSv3 and v2.

[snip...]

Comment 8 errata-xmlrpc 2016-11-04 05:04:20 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://rhn.redhat.com/errata/RHBA-2016-2383.html