提交 ae64d846 编写于 作者: T Trond Myklebust 提交者: Laibin Qiu

NFSv4: Don't hold the layoutget locks across multiple RPC calls

stable inclusion
from stable-4.19.247
commit 6b3fc1496e7227cd6a39a80bbfb7588ef7c7a010
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5FNPY
CVE: NA

--------------------------------

[ Upstream commit 69494938 ]

When doing layoutget as part of the open() compound, we have to be
careful to release the layout locks before we can call any further RPC
calls, such as setattr(). The reason is that those calls could trigger
a recall, which could deadlock.
Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYongqiang Liu <liuyongqiang13@huawei.com>
Signed-off-by: NLaibin Qiu <qiulaibin@huawei.com>
上级 dbed45ae
...@@ -2964,6 +2964,10 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata, ...@@ -2964,6 +2964,10 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata,
} }
out: out:
if (opendata->lgp) {
nfs4_lgopen_release(opendata->lgp);
opendata->lgp = NULL;
}
if (!opendata->cancelled) if (!opendata->cancelled)
nfs4_sequence_free_slot(&opendata->o_res.seq_res); nfs4_sequence_free_slot(&opendata->o_res.seq_res);
return ret; return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册