Red Hat Bugzilla – Bug 1489247
autofs: config mount_nfs_default_protocol doesn't work
Last modified: 2018-04-10 14:18:00 EDT
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:
(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.
(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?
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.
(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.
Created attachment 1337490 [details] Patch - improve description of mount_nfs_default_protocol Before I actually commit this change is this adequate?
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