Bug 1489247

Summary: autofs: config mount_nfs_default_protocol doesn't work
Product: Red Hat Enterprise Linux 7 Reporter: xiaoli feng <xifeng>
Component: autofsAssignee: Ian Kent <ikent>
Status: CLOSED ERRATA QA Contact: xiaoli feng <xifeng>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.5CC: xifeng, xzhou
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: autofs-5.0.7-75.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 18:17:12 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:
Attachments:
Description Flags
Patch - improve description of mount_nfs_default_protocol none

Description xiaoli feng 2017-09-07 04:05:59 UTC
Description of problem:

[root@10 ~]# cat /etc/auto.master
/autofs /etc/nfs.misc  --nobind
[root@10 ~]# cat /etc/nfs.misc 
nfs localhost:/exports
[root@10 ~]# 

Modify the  value of mount_nfs_default_protocol to 3.

[root@10 ~]# grep -r mount_nfs_default_protocol  /etc/autofs.conf 
# mount_nfs_default_protocol - specify the default protocol used by
#mount_nfs_default_protocol = 3
mount_nfs_default_protocol = 3

Restart autofs and check mount info.

[root@10 ~]# mount |grep autofs
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=27,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=11217)
/etc/nfs.misc on /autofs type autofs (rw,relatime,fd=7,pgrp=17758,timeout=300,minproto=5,maxproto=5,indirect,pipe_ino=476730)
localhost:/exports on /autofs/nfs type nfs4 (rw,relatime,vers=4.1,rsize=524288,wsize=524288,namlen=255,hard,proto=tcp6,port=0,timeo=600,retrans=2,sec=sys,clientaddr=::1,local_lock=none,addr=::1)
[root@10 ~]# 

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

autofs-5.0.7-69.el7.x86_64
How reproducible:

100%
Steps to Reproduce:
1.
2.
3.

Actual results:

config mount_nfs_default_protocol doesn't work

Expected results:

config mount_nfs_default_protocol work

Additional info:

Comment 2 Ian Kent 2017-09-11 04:19:03 UTC
(In reply to xiaoli feng from comment #0)
> Actual results:
> 
> config mount_nfs_default_protocol doesn't work

Perhaps this configuration option is badly described.

It is meant to be used to tell autofs what default will be
used for nfs mounts by mount.nfs, IOW when vers is not
specified with the mount options.

Maybe this should be automated, and removed as a config
option, by checking the contents of /etc/nfsmount.conf.

If it doesn't exist then it would be vers 3, if it does
exist then I would have to scan /etc/nfsmount.conf.

It isn't meant to have any effect on what mount.nfs does.

Comment 3 Ian Kent 2017-10-03 02:50:24 UTC
(In reply to Ian Kent from comment #2)
> (In reply to xiaoli feng from comment #0)
> > Actual results:
> > 
> > config mount_nfs_default_protocol doesn't work
> 
> Perhaps this configuration option is badly described.
> 
> It is meant to be used to tell autofs what default will be
> used for nfs mounts by mount.nfs, IOW when vers is not
> specified with the mount options.
> 
> Maybe this should be automated, and removed as a config
> option, by checking the contents of /etc/nfsmount.conf.
> 
> If it doesn't exist then it would be vers 3, if it does
> exist then I would have to scan /etc/nfsmount.conf.
> 
> It isn't meant to have any effect on what mount.nfs does.

What are you recommending I do about this?

Comment 4 xiaoli feng 2017-10-09 09:50:18 UTC
I think we can remove it. Because mount.nfs already has default version. By the way, remove /etc/nfsmount.conf. mount_nfs_default_protocol also can't work. It's just my opinion.

Comment 5 Ian Kent 2017-10-11 06:25:56 UTC
(In reply to xiaoli feng from comment #4)
> I think we can remove it. Because mount.nfs already has default version. By
> the way, remove /etc/nfsmount.conf. mount_nfs_default_protocol also can't
> work. It's just my opinion.

So you're asking me to write code to interrogate /etc/nfsmount.conf
so I can work out what the default mount version is?

That also involves knowledge of what version of nfs-utils made what
changes to this (further complicated because different distributions
may have made changes to different version of the package).

autofs does need to know what the mount.nfs default protocol version
is.

Removing /etc/nfsmount.conf is the same as if the default setting
is commented out. When this is commented out (or the configuration
missing), which it is by default, I have to assume it's version 4
or rely on the setting of mount_nfs_default_protocol both of which
could be incorrect.

Comment 10 Ian Kent 2017-10-12 02:50:12 UTC
Created attachment 1337490 [details]
Patch - improve description of mount_nfs_default_protocol

Before I actually commit this change is this adequate?

Comment 19 errata-xmlrpc 2018-04-10 18:17:12 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-2018:0977