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

pNFS: Mark layout for return if return-on-close was not sent

stable inclusion
from linux-4.19.169
commit 87396ce3b5059916e81b6c3456a5c2b9b7636b5f

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

commit 67bbceed upstream.

If the layout return-on-close failed because the layoutreturn was never
sent, then we should mark the layout for return again.

Fixes: 9c47b18c ("pNFS: Ensure we do clear the return-on-close layout stateid on fatal errors")
Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NCheng Jian <cj.chengjian@huawei.com>
上级 643d973a
......@@ -1451,12 +1451,18 @@ void pnfs_roc_release(struct nfs4_layoutreturn_args *args,
int ret)
{
struct pnfs_layout_hdr *lo = args->layout;
struct inode *inode = args->inode;
const nfs4_stateid *arg_stateid = NULL;
const nfs4_stateid *res_stateid = NULL;
struct nfs4_xdr_opaque_data *ld_private = args->ld_private;
switch (ret) {
case -NFS4ERR_NOMATCHING_LAYOUT:
spin_lock(&inode->i_lock);
if (pnfs_layout_is_valid(lo) &&
nfs4_stateid_match_other(&args->stateid, &lo->plh_stateid))
pnfs_set_plh_return_info(lo, args->range.iomode, 0);
spin_unlock(&inode->i_lock);
break;
case 0:
if (res->lrs_present)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册