aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/direct.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2015-12-31 09:28:06 -0500
committerTrond Myklebust <trond.myklebust@primarydata.com>2015-12-31 15:55:35 -0500
commitb20135d0b2431900a3a5395970ffb7e4f3767c8b (patch)
tree480ca93f19626e451cb79b35f29ad86d28da0fbb /fs/nfs/direct.c
parentaf7cf057933f01dc7f33ddfb5e436ad598ed17ad (diff)
NFSv4.1/pNFS: Don't queue up a new commit if the layout segment is invalid
If the layout segment is invalid, then we should not be adding more write requests to the commit list. Instead, those writes should be replayed after requesting a new layout. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/direct.c')
-rw-r--r--fs/nfs/direct.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index 14f77df79c25..a9a93927fe3e 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -721,8 +721,20 @@ static void nfs_direct_commit_complete(struct nfs_commit_data *data)
721 nfs_direct_write_complete(dreq, data->inode); 721 nfs_direct_write_complete(dreq, data->inode);
722} 722}
723 723
724static void nfs_direct_resched_write(struct nfs_commit_info *cinfo,
725 struct nfs_page *req)
726{
727 struct nfs_direct_req *dreq = cinfo->dreq;
728
729 spin_lock(&dreq->lock);
730 dreq->flags = NFS_ODIRECT_RESCHED_WRITES;
731 spin_unlock(&dreq->lock);
732 nfs_mark_request_commit(req, NULL, cinfo, 0);
733}
734
724static const struct nfs_commit_completion_ops nfs_direct_commit_completion_ops = { 735static const struct nfs_commit_completion_ops nfs_direct_commit_completion_ops = {
725 .completion = nfs_direct_commit_complete, 736 .completion = nfs_direct_commit_complete,
737 .resched_write = nfs_direct_resched_write,
726}; 738};
727 739
728static void nfs_direct_commit_schedule(struct nfs_direct_req *dreq) 740static void nfs_direct_commit_schedule(struct nfs_direct_req *dreq)