All of lore.kernel.org
 help / color / mirror / Atom feed
From: Scott Mayhew <smayhew@redhat.com>
To: trond.myklebust@primarydata.com
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH 0/1] nfs: Ensure NFS_MOUNT_TCP is correctly set for v4 mounts
Date: Thu, 29 May 2014 13:25:50 -0400	[thread overview]
Message-ID: <1401384351-21993-1-git-send-email-smayhew@redhat.com> (raw)

When a 'mount -o remount...' is issued, the mount program reads the current
mount options from /etc/mtab so that it can pass them to the helper program.  On
newer distros where /etc/mtab is a symlink to /proc/mounts, this will result in
a call to nfs_show_mount_options(), which has the following snippet:

        seq_printf(m, ",proto=%s",
	                   rpc_peeraddr2str(nfss->client, RPC_DISPLAY_NETID));

which in most cases will result in the mount program passing 'proto=tcp' to the
mount.nfs4 program, which mount.nfs4 then passes in the data field of the mount
syscall. 

nfs_remount() calls nfs_parse_mount_options(), where the NFS_MOUNT_TCP flag will
be set in the nfs_parsed_mount_data's flag field.  But nfs_remount() then calls
nfs_compare_remount_data(), where we will fail the very first check:

static int
nfs_compare_remount_data(struct nfs_server *nfss,
                         struct nfs_parsed_mount_data *data)
{
	        if (data->flags != nfss->flags ||
...
                return -EINVAL;
...

because NFS_MOUNT_TCP was never set in the nfs_server's flags field in the first
place.

As a result, the remount operation fails:
# mount -o remount,ro /mnt/t
mount.nfs4: an incorrect mount option was specified

The following patch corrects that issue by having nfs4_validate_mount_flags()
set the NFS_MOUNT_TCP flag when appropriate.


Scott Mayhew (1):
  nfs: Ensure NFS_MOUNT_TCP is correctly set for v4 mounts

 fs/nfs/super.c | 3 +++
 1 file changed, 3 insertions(+)

-- 
1.9.0


             reply	other threads:[~2014-05-29 17:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-29 17:25 Scott Mayhew [this message]
2014-05-29 17:25 ` [PATCH 1/1] nfs: Ensure NFS_MOUNT_TCP is correctly set for v4 mounts Scott Mayhew
2014-05-29 17:33   ` Trond Myklebust

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=1401384351-21993-1-git-send-email-smayhew@redhat.com \
    --to=smayhew@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@primarydata.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.