From: Jeff Layton <jlayton@redhat.com>
To: trond.myklebust@netapp.com
Cc: chuck.lever@oracle.com, linux-nfs@vger.kernel.org
Subject: [PATCH 1/2] nfs: make nfs_select_flavor take a list of authflavors and a length
Date: Wed, 26 Jun 2013 10:36:02 -0400 [thread overview]
Message-ID: <1372257363-28148-2-git-send-email-jlayton@redhat.com> (raw)
In-Reply-To: <1372257363-28148-1-git-send-email-jlayton@redhat.com>
We don't actually need a nfs_mount_request structure here, and by
doing this we can call this function outside of nfs_request_mount().
Cc: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
---
fs/nfs/super.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 2d7525f..5538bcc 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -1614,9 +1614,9 @@ out_security_failure:
* Returns 0 on success, -EACCES on failure.
*/
static int nfs_select_flavor(struct nfs_parsed_mount_data *args,
- struct nfs_mount_request *request)
+ unsigned int count, rpc_authflavor_t *server_authlist)
{
- unsigned int i, count = *(request->auth_flav_len);
+ unsigned int i;
rpc_authflavor_t flavor;
/*
@@ -1642,8 +1642,8 @@ static int nfs_select_flavor(struct nfs_parsed_mount_data *args,
*/
if (args->auth_flavors[0] != RPC_AUTH_MAXFLAVOR) {
for (i = 0; i < count; i++) {
- if (args->auth_flavors[0] == request->auth_flavs[i] ||
- request->auth_flavs[i] == RPC_AUTH_NULL)
+ if (args->auth_flavors[0] == server_authlist[i] ||
+ server_authlist[i] == RPC_AUTH_NULL)
goto out;
}
dfprintk(MOUNT, "NFS: auth flavor %d not supported by server\n",
@@ -1659,7 +1659,7 @@ static int nfs_select_flavor(struct nfs_parsed_mount_data *args,
for (i = 0; i < count; i++) {
struct rpcsec_gss_info info;
- flavor = request->auth_flavs[i];
+ flavor = server_authlist[i];
switch (flavor) {
case RPC_AUTH_UNIX:
goto out_set;
@@ -1676,7 +1676,7 @@ static int nfs_select_flavor(struct nfs_parsed_mount_data *args,
* if it does, use the default flavor.
*/
for (i = 0; i < count; i++) {
- if (request->auth_flavs[i] == RPC_AUTH_NULL)
+ if (server_authlist[i] == RPC_AUTH_NULL)
goto out_default;
}
@@ -1756,7 +1756,7 @@ static int nfs_request_mount(struct nfs_parsed_mount_data *args,
return status;
}
- return nfs_select_flavor(args, &request);
+ return nfs_select_flavor(args, server_authlist_len, server_authlist);
}
struct dentry *nfs_try_mount(int flags, const char *dev_name,
--
1.8.1.4
next prev parent reply other threads:[~2013-06-26 14:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-26 14:36 [PATCH 0/2] nfs: allow NFSv3 to fall back to AUTH_UNIX if initial auth selection fails Jeff Layton
2013-06-26 14:36 ` Jeff Layton [this message]
2013-06-26 14:36 ` [PATCH 2/2] nfs: allow NFSv3 to fall back to using AUTH_UNIX automatically if available Jeff Layton
2013-06-26 15:15 ` Chuck Lever
2013-06-26 15:24 ` Jeff Layton
2013-06-26 15:37 ` Chuck Lever
2013-06-26 15:41 ` Jeff Layton
2013-06-26 15:29 ` Jeff Layton
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=1372257363-28148-2-git-send-email-jlayton@redhat.com \
--to=jlayton@redhat.com \
--cc=chuck.lever@oracle.com \
--cc=linux-nfs@vger.kernel.org \
--cc=trond.myklebust@netapp.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 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).