linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [nfs-utils PATCH 0/4] Improve nfsmount.conf configuration parsing.
@ 2013-08-13 19:20 Scott Mayhew
  2013-08-13 19:20 ` [nfs-utils PATCH 1/4] mount.nfs: avoid unnecessary duplication of options passed to mount(2) Scott Mayhew
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Scott Mayhew @ 2013-08-13 19:20 UTC (permalink / raw)
  To: linux-nfs

The parsing of the nfsmount.conf configuration file has various issues.

Here's an example config file I've been testing with:

# cat /etc/nfsmount.conf
[ NFSMount_Global_Options ]
	Acl=False
	Ac=False
	Timeo=600
	Background=True

[ Server "nfs.smayhew.test" ]
	Sec=krb5p
	Nfsvers=4
	Acl=True
	Ac=True
	Timeo=300
	Sloppy=True
	Foreground=True

[ Server "rhel7alpha2.smayhew.test" ]
	Sec=krb5i
	Nfsvers=4

[ Server "rhel6u2.smayhew.test" ]
	Nfsvers=4	

[ Server "rhel5u8.smayhew.test" ]
	Nfsvers=3

[ Server "rhel4u8.smayhew.test" ]
	Nfsvers=3

[ MountPoint "/mnt/nfs" ]
	Timeo=150
	Background=False
	Ac=False
	Sloppy=False

I then mount a filesystem using:

# mount nfs.smayhew.test:/export /mnt/nfs
  
# mount | grep smayhew
nfs.smayhew.test:/export on /mnt/nfs type nfs
(rw,timeo=600,bg,sec=krb5p,nfsvers=4,acl,ac,timeo=300,sloppy,fg,sec=krb5p,nfsvers=4,nfsvers=4,nfsvers=4,nfsvers=4,addr=192.168.122.179,clientaddr=192.168.122.202)
# grep smayhew /proc/mounts
nfs.smayhew.test:/export/ /mnt/nfs nfs4
rw,relatime,vers=4,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,port=0,timeo=300,retrans=2,sec=krb5p,clientaddr=192.168.122.202,minorversion=0,local_lock=none,addr=192.168.122.179
0 0

In the output of mount (no arguments) as well as /etc/mtab,
1. nfsvers=4 is shown four times
2. sec=krb5p is shown twice
3. both fg and bg is shown
4. timeo appears twice

In /proc/mounts we can see that we have the wrong value for timeo (it should be
150).

In newer distros where /etc/mtab is a symlink to /proc/mounts, you're unlikely
to see most of these issues unless you're watching the mount command with
something like systemtap, e.g.

# stap -e 'probe syscall.mount { printf("%s %s\n", probefunc(),
# kernel_string($data)) }'
sys_mount
timeo=600,bg,sec=krb5p,nfsvers=4,acl,ac,timeo=300,sloppy,fg,sec=krb5p,nfsvers=4,nfsvers=4,nfsvers=4,nfsvers=4,addr=192.168.122.179,clientaddr=192.168.122.202

Regardless, rather than sending a slew of mount options and letting the kernel
sort it out, we can do a better job of parsing them on the front end.


Scott Mayhew (4):
  mount.nfs: avoid unnecessary duplication of options passed to
    mount(2)
  mount.nfs: avoid sending conflicting mount options
  mount.nfs:  improve handling of MNT_NOARG type options
  mount.nfs:  clean up conf_parse_mntopts()

 support/include/conffile.h |  2 +-
 support/nfs/conffile.c     |  4 ++-
 utils/mount/configfile.c   | 77 +++++++++++++++++++++++++++++++++++++++++-----
 3 files changed, 73 insertions(+), 10 deletions(-)

-- 
1.7.11.7


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-08-14 14:24 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-13 19:20 [nfs-utils PATCH 0/4] Improve nfsmount.conf configuration parsing Scott Mayhew
2013-08-13 19:20 ` [nfs-utils PATCH 1/4] mount.nfs: avoid unnecessary duplication of options passed to mount(2) Scott Mayhew
2013-08-13 19:30   ` Chuck Lever
2013-08-13 22:39     ` Scott Mayhew
2013-08-14  1:29       ` Chuck Lever
2013-08-14 14:24         ` Scott Mayhew
2013-08-13 19:20 ` [nfs-utils PATCH 2/4] mount.nfs: avoid sending conflicting mount options Scott Mayhew
2013-08-13 19:20 ` [nfs-utils PATCH 3/4] mount.nfs: improve handling of MNT_NOARG type options Scott Mayhew
2013-08-13 19:32   ` Chuck Lever
2013-08-13 22:45     ` Scott Mayhew
2013-08-14  1:46       ` Chuck Lever
2013-08-13 19:20 ` [nfs-utils PATCH 4/4] mount.nfs: clean up conf_parse_mntopts() Scott Mayhew

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).