From: Steve Dickson <steved@redhat.com>
To: Linux NFS Mailing list <linux-nfs@vger.kernel.org>
Subject: [PATCH 2/2] mount.nfs: v4 mounts should fail when nfs4 is specified with -t flag
Date: Fri, 19 May 2017 18:25:10 -0400 [thread overview]
Message-ID: <20170519222510.31205-2-steved@redhat.com> (raw)
In-Reply-To: <20170519222510.31205-1-steved@redhat.com>
When the pseudo root is set with fsid=0, explicit v4
mounts (set with the -t fstype mount flag) should
fail when the incorrect export is tried instead
of rolling back to v3.
Signed-off-by: Steve Dickson <steved@redhat.com>
---
utils/mount/stropts.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
index 0fbb375..a56e965 100644
--- a/utils/mount/stropts.c
+++ b/utils/mount/stropts.c
@@ -315,9 +315,10 @@ static int nfs_set_version(struct nfsmount_info *mi)
if (!nfs_nfs_version(mi->options, &mi->version))
return 0;
- if (strncmp(mi->type, "nfs4", 4) == 0)
+ if (strncmp(mi->type, "nfs4", 4) == 0) {
mi->version.major = 4;
-
+ mi->version.v_mode = V_SPECIFIC;
+ }
/*
* Before 2.6.32, the kernel NFS client didn't
* support "-t nfs vers=4" mounts, so NFS version
--
2.9.4
next prev parent reply other threads:[~2017-05-19 22:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-19 22:25 [PATCH 1/2] mount.nfs: v4 mounts should fail when -o flag is used Steve Dickson
2017-05-19 22:25 ` Steve Dickson [this message]
2017-05-22 3:03 ` NeilBrown
2017-05-22 14:30 ` Steve Dickson
2017-05-23 0:52 ` NeilBrown
2017-05-31 15:33 ` Steve Dickson
2017-06-01 0:22 ` [PATCH] mount.nfs: improve version negotiation when vers=4 is specified NeilBrown
2017-06-01 14:02 ` Steve Dickson
2017-06-01 0:27 ` [PATCH 1/2] mount.nfs: v4 mounts should fail when -o flag is used NeilBrown
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=20170519222510.31205-2-steved@redhat.com \
--to=steved@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).