Skip to content

Commit

Permalink
nfs/filelayout: set layoutcommit depending on write verifier
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Peng Tao authored and Trond Myklebust committed Sep 10, 2014
1 parent 378520b commit bc7d4b8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fs/nfs/filelayout/filelayout.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ filelayout_set_layoutcommit(struct nfs_pgio_header *hdr)
{

if (FILELAYOUT_LSEG(hdr->lseg)->commit_through_mds ||
hdr->res.verf->committed == NFS_FILE_SYNC)
hdr->res.verf->committed != NFS_DATA_SYNC)
return;

pnfs_set_layoutcommit(hdr);
Expand Down Expand Up @@ -403,6 +403,9 @@ static int filelayout_commit_done_cb(struct rpc_task *task,
return -EAGAIN;
}

if (data->verf.committed == NFS_UNSTABLE)
pnfs_commit_set_layoutcommit(data);

return 0;
}

Expand Down

0 comments on commit bc7d4b8

Please sign in to comment.