aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/filelayout/filelayout.c
diff options
context:
space:
mode:
authorPeng Tao <tao.peng@primarydata.com>2014-08-06 22:15:03 -0400
committerTrond Myklebust <trond.myklebust@primarydata.com>2014-09-10 15:47:01 -0400
commitbc7d4b8fd0917b4b84a8911185d34a97c696f219 (patch)
tree4f6478838ad3a80e691b6cc70efd0dc3c552e3c5 /fs/nfs/filelayout/filelayout.c
parent378520b837cf4da769600b83690d8e825f16a611 (diff)
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: Peng Tao <tao.peng@primarydata.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/filelayout/filelayout.c')
-rw-r--r--fs/nfs/filelayout/filelayout.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/nfs/filelayout/filelayout.c b/fs/nfs/filelayout/filelayout.c
index 90978075f730..163cad1d4127 100644
--- a/fs/nfs/filelayout/filelayout.c
+++ b/fs/nfs/filelayout/filelayout.c
@@ -265,7 +265,7 @@ filelayout_set_layoutcommit(struct nfs_pgio_header *hdr)
265{ 265{
266 266
267 if (FILELAYOUT_LSEG(hdr->lseg)->commit_through_mds || 267 if (FILELAYOUT_LSEG(hdr->lseg)->commit_through_mds ||
268 hdr->res.verf->committed == NFS_FILE_SYNC) 268 hdr->res.verf->committed != NFS_DATA_SYNC)
269 return; 269 return;
270 270
271 pnfs_set_layoutcommit(hdr); 271 pnfs_set_layoutcommit(hdr);
@@ -403,6 +403,9 @@ static int filelayout_commit_done_cb(struct rpc_task *task,
403 return -EAGAIN; 403 return -EAGAIN;
404 } 404 }
405 405
406 if (data->verf.committed == NFS_UNSTABLE)
407 pnfs_commit_set_layoutcommit(data);
408
406 return 0; 409 return 0;
407} 410}
408 411