diff options
author | J. Bruce Fields <bfields@citi.umich.edu> | 2005-06-22 13:16:23 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2005-06-22 16:07:16 -0400 |
commit | 6a19275ada9137435da58990c8f8d3f58e170bf1 (patch) | |
tree | 927f8aa96c9b558a0bed5355dde66df9c0ec8554 /net/sunrpc/clnt.c | |
parent | 438b6fdebf2a2e8573e7290bc176feb4d4475f43 (diff) |
[PATCH] RPC: [PATCH] improve rpcauthauth_create error returns
Currently we return -ENOMEM for every single failure to create a new auth.
This is actually accurate for auth_null and auth_unix, but for auth_gss it's a
bit confusing.
Allow rpcauth_create (and the ->create methods) to return errors. With this
patch, the user may sometimes see an EINVAL instead. Whee.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/clnt.c')
-rw-r--r-- | net/sunrpc/clnt.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index b36797ad8083..9da1deb482e2 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c | |||
@@ -103,6 +103,7 @@ rpc_new_client(struct rpc_xprt *xprt, char *servname, | |||
103 | { | 103 | { |
104 | struct rpc_version *version; | 104 | struct rpc_version *version; |
105 | struct rpc_clnt *clnt = NULL; | 105 | struct rpc_clnt *clnt = NULL; |
106 | struct rpc_auth *auth; | ||
106 | int err; | 107 | int err; |
107 | int len; | 108 | int len; |
108 | 109 | ||
@@ -157,10 +158,11 @@ rpc_new_client(struct rpc_xprt *xprt, char *servname, | |||
157 | if (err < 0) | 158 | if (err < 0) |
158 | goto out_no_path; | 159 | goto out_no_path; |
159 | 160 | ||
160 | err = -ENOMEM; | 161 | auth = rpcauth_create(flavor, clnt); |
161 | if (!rpcauth_create(flavor, clnt)) { | 162 | if (IS_ERR(auth)) { |
162 | printk(KERN_INFO "RPC: Couldn't create auth handle (flavor %u)\n", | 163 | printk(KERN_INFO "RPC: Couldn't create auth handle (flavor %u)\n", |
163 | flavor); | 164 | flavor); |
165 | err = PTR_ERR(auth); | ||
164 | goto out_no_auth; | 166 | goto out_no_auth; |
165 | } | 167 | } |
166 | 168 | ||