提交 01f9b568 编写于 作者: T Trond Myklebust 提交者: Yang Yingliang

NFSv4: Fix second deadlock in nfs4_evict_inode()

hulk inclusion
category: bugfix
bugzilla: 51898
CVE: NA

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

If the inode is being evicted but has to return a layout first, then
that too can cause a deadlock in the corner case where the server
reboots.
Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: NZhang Xiaoxu <zhangxiaoxu5@huawei.com>
Reviewed-by: NZhang Yi <yi.zhang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 d1c9802f
...@@ -9187,15 +9187,20 @@ int nfs4_proc_layoutreturn(struct nfs4_layoutreturn *lrp, bool sync) ...@@ -9187,15 +9187,20 @@ int nfs4_proc_layoutreturn(struct nfs4_layoutreturn *lrp, bool sync)
&task_setup_data.rpc_client, &msg); &task_setup_data.rpc_client, &msg);
dprintk("--> %s\n", __func__); dprintk("--> %s\n", __func__);
if (!sync) {
lrp->inode = nfs_igrab_and_active(lrp->args.inode); lrp->inode = nfs_igrab_and_active(lrp->args.inode);
if (!sync) {
if (!lrp->inode) { if (!lrp->inode) {
nfs4_layoutreturn_release(lrp); nfs4_layoutreturn_release(lrp);
return -EAGAIN; return -EAGAIN;
} }
task_setup_data.flags |= RPC_TASK_ASYNC; task_setup_data.flags |= RPC_TASK_ASYNC;
} }
nfs4_init_sequence(&lrp->args.seq_args, &lrp->res.seq_res, 1, 0); if (!lrp->inode)
nfs4_init_sequence(&lrp->args.seq_args, &lrp->res.seq_res, 1,
1);
else
nfs4_init_sequence(&lrp->args.seq_args, &lrp->res.seq_res, 1,
0);
task = rpc_run_task(&task_setup_data); task = rpc_run_task(&task_setup_data);
if (IS_ERR(task)) if (IS_ERR(task))
return PTR_ERR(task); return PTR_ERR(task);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册