提交 bc7d4b8f 编写于 作者: P Peng Tao 提交者: Trond Myklebust

nfs/filelayout: set layoutcommit depending on write verifier

Following http://www.rfc-editor.org/errata_search.php?rfc=5661&eid=2751
Don't set layoutcommit for commit_through_mds case.
For FILE_SYNC writes, don't set layoutcommit.
For DATA_SYNC wirtes, set layout commit right after wirtes done.
For UNSTABLE writes, set layout commit when commit done.
Signed-off-by: NPeng Tao <tao.peng@primarydata.com>
Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
上级 378520b8
...@@ -265,7 +265,7 @@ filelayout_set_layoutcommit(struct nfs_pgio_header *hdr) ...@@ -265,7 +265,7 @@ filelayout_set_layoutcommit(struct nfs_pgio_header *hdr)
{ {
if (FILELAYOUT_LSEG(hdr->lseg)->commit_through_mds || if (FILELAYOUT_LSEG(hdr->lseg)->commit_through_mds ||
hdr->res.verf->committed == NFS_FILE_SYNC) hdr->res.verf->committed != NFS_DATA_SYNC)
return; return;
pnfs_set_layoutcommit(hdr); pnfs_set_layoutcommit(hdr);
...@@ -403,6 +403,9 @@ static int filelayout_commit_done_cb(struct rpc_task *task, ...@@ -403,6 +403,9 @@ static int filelayout_commit_done_cb(struct rpc_task *task,
return -EAGAIN; return -EAGAIN;
} }
if (data->verf.committed == NFS_UNSTABLE)
pnfs_commit_set_layoutcommit(data);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册