summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorBryan Schumaker <bjschuma@netapp.com>2011-04-13 20:31:30 +0200
committerTrond Myklebust <Trond.Myklebust@netapp.com>2011-04-13 21:12:23 +0200
commit9b7160c55a41dd2fec3d467f979e55782d3f92ad (patch)
tree5a0d71d9a9ed1cfee60014b3b10d71232dee0a09 /fs
parentNFS: Attempt mount with default sec flavor first (diff)
downloadlinux-9b7160c55a41dd2fec3d467f979e55782d3f92ad.tar.xz
linux-9b7160c55a41dd2fec3d467f979e55782d3f92ad.zip
NFS: don't negotiate when user specifies sec flavor
We were always attempting sec flavor negotiation, even if the user told us a specific sec flavor to use. If that sec flavor fails, we should return an error rather than continuing with sec flavor negotiation. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/nfs4proc.c3
-rw-r--r--fs/nfs/super.c1
2 files changed, 3 insertions, 1 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 7e27ebf5be5d..b8e1ac69b743 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -46,6 +46,7 @@
#include <linux/nfs4.h>
#include <linux/nfs_fs.h>
#include <linux/nfs_page.h>
+#include <linux/nfs_mount.h>
#include <linux/namei.h>
#include <linux/mount.h>
#include <linux/module.h>
@@ -2234,7 +2235,7 @@ static int nfs4_proc_get_root(struct nfs_server *server, struct nfs_fh *fhandle,
struct nfs_fsinfo *info)
{
int status = nfs4_lookup_root(server, fhandle, info);
- if (status == -EPERM)
+ if ((status == -EPERM) && !(server->flags & NFS_MOUNT_SECFLAVOUR))
status = nfs4_find_root_sec(server, fhandle, info);
if (status == 0)
status = nfs4_server_capabilities(server, fhandle);
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 685a8a7bd17b..75bcc3f0e0b5 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -1004,6 +1004,7 @@ static int nfs_parse_security_flavors(char *value,
return 0;
}
+ mnt->flags |= NFS_MOUNT_SECFLAVOUR;
mnt->auth_flavor_len = 1;
return 1;
}