mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-04-13 06:18:01 +07:00
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>
This commit is contained in:
parent
1654a04cd7
commit
a92e5eb110
@ -1317,10 +1317,10 @@ static ssize_t write_gssp(struct file *file, const char __user *buf,
|
|||||||
return res;
|
return res;
|
||||||
if (i != 1)
|
if (i != 1)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
res = set_gss_proxy(net, 1);
|
res = set_gssp_clnt(net);
|
||||||
if (res)
|
if (res)
|
||||||
return res;
|
return res;
|
||||||
res = set_gssp_clnt(net);
|
res = set_gss_proxy(net, 1);
|
||||||
if (res)
|
if (res)
|
||||||
return res;
|
return res;
|
||||||
return count;
|
return count;
|
||||||
|
Loading…
Reference in New Issue
Block a user