diff options
author | Jeff Layton <jlayton@redhat.com> | 2014-01-04 07:18:04 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2014-01-06 15:14:17 -0500 |
commit | a92e5eb1103341e985a575e48e26f87fbb9b1679 (patch) | |
tree | 1664ccd9c43785c5daa99e76a641cacb53c546c8 /net | |
parent | 1654a04cd702fd19c297c36300a6ab834cf8c072 (diff) |
sunrpc: fix potential race between setting use_gss_proxy and the upcall rpc_clnt
An nfsd thread can call use_gss_proxy and find it set to '1' but find
gssp_clnt still NULL, so that when it attempts the upcall the result
will be an unnecessary -EIO.
So, ensure that gssp_clnt is created first, and set the use_gss_proxy
variable only if that succeeds.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/auth_gss/svcauth_gss.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c index 1b94a9c8a242..60dc3700b2cb 100644 --- a/net/sunrpc/auth_gss/svcauth_gss.c +++ b/net/sunrpc/auth_gss/svcauth_gss.c | |||
@@ -1317,10 +1317,10 @@ static ssize_t write_gssp(struct file *file, const char __user *buf, | |||
1317 | return res; | 1317 | return res; |
1318 | if (i != 1) | 1318 | if (i != 1) |
1319 | return -EINVAL; | 1319 | return -EINVAL; |
1320 | res = set_gss_proxy(net, 1); | 1320 | res = set_gssp_clnt(net); |
1321 | if (res) | 1321 | if (res) |
1322 | return res; | 1322 | return res; |
1323 | res = set_gssp_clnt(net); | 1323 | res = set_gss_proxy(net, 1); |
1324 | if (res) | 1324 | if (res) |
1325 | return res; | 1325 | return res; |
1326 | return count; | 1326 | return count; |