linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Scott Mayhew <smayhew@redhat.com>
To: linux-nfs@vger.kernel.org
Subject: [nfs-utils PATCH 0/4] Improve nfsmount.conf configuration parsing.
Date: Tue, 13 Aug 2013 15:20:25 -0400	[thread overview]
Message-ID: <1376421629-21382-1-git-send-email-smayhew@redhat.com> (raw)

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


             reply	other threads:[~2013-08-13 19:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-13 19:20 Scott Mayhew [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1376421629-21382-1-git-send-email-smayhew@redhat.com \
    --to=smayhew@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).