RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1489247 - autofs: config mount_nfs_default_protocol doesn't work
Summary: autofs: config mount_nfs_default_protocol doesn't work
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: autofs
Version: 7.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Ian Kent
QA Contact: xiaoli feng
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-09-07 04:05 UTC by xiaoli feng
Modified: 2018-04-10 18:18 UTC (History)
2 users (show)

Fixed In Version: autofs-5.0.7-75.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-10 18:17:12 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Patch - improve description of mount_nfs_default_protocol (2.82 KB, patch)
2017-10-12 02:50 UTC, Ian Kent
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0977 0 None None None 2018-04-10 18:18:00 UTC

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


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