提交 a92e5eb1 编写于 作者: J Jeff Layton 提交者: J. Bruce Fields

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: NJeff Layton <jlayton@redhat.com>
Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
上级 1654a04c
......@@ -1317,10 +1317,10 @@ static ssize_t write_gssp(struct file *file, const char __user *buf,
return res;
if (i != 1)
return -EINVAL;
res = set_gss_proxy(net, 1);
res = set_gssp_clnt(net);
if (res)
return res;
res = set_gssp_clnt(net);
res = set_gss_proxy(net, 1);
if (res)
return res;
return count;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册