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

pNFS/NFSv4: Try to return invalid layout in pnfs_layout_process()

stable inclusion
from linux-4.19.176
commit 682821d905f77005b1b85684608dfc75e75422a9

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

[ Upstream commit 08bd8dbe ]

If the server returns a new stateid that does not match the one in our
cache, then try to return the one we hold instead of just invalidating
it on the client side. This ensures that both client and server will
agree that the stateid is invalid.
Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: NHou Tao <houtao1@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 8886ed9e
...@@ -2301,7 +2301,13 @@ pnfs_layout_process(struct nfs4_layoutget *lgp) ...@@ -2301,7 +2301,13 @@ pnfs_layout_process(struct nfs4_layoutget *lgp)
* We got an entirely new state ID. Mark all segments for the * We got an entirely new state ID. Mark all segments for the
* inode invalid, and retry the layoutget * inode invalid, and retry the layoutget
*/ */
pnfs_mark_layout_stateid_invalid(lo, &free_me); struct pnfs_layout_range range = {
.iomode = IOMODE_ANY,
.length = NFS4_MAX_UINT64,
};
pnfs_set_plh_return_info(lo, IOMODE_ANY, 0);
pnfs_mark_matching_lsegs_return(lo, &lo->plh_return_segs,
&range, 0);
goto out_forget; goto out_forget;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册