aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/write.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2012-09-11 16:01:22 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-09-28 16:03:05 -0400
commit05990d1bf2708b9e84d67074551f964d3738eedc (patch)
treeb4133627b503563eadea21aab695df78080402e1 /fs/nfs/write.c
parent795a88c968eef031f370973512b42124bacb2f17 (diff)
NFS: Fix fdatasync/fsync() when confronted with a server reboot
If the server reboots before it can commit the unstable writes to disk, then nfs_commit_release_pages() will detect this when it compares the verifier returned by COMMIT to the one returned by WRITE. When this happens, the client needs to resend those writes in order to guarantee that they make it to stable storage. This patch adds a signalling mechanism to notify fsync() that it needs to retry all writes before it can exit. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r--fs/nfs/write.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index e1b5fe4d873a..9347ab7c9574 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -1580,6 +1580,7 @@ static void nfs_commit_release_pages(struct nfs_commit_data *data)
1580 /* We have a mismatch. Write the page again */ 1580 /* We have a mismatch. Write the page again */
1581 dprintk(" mismatch\n"); 1581 dprintk(" mismatch\n");
1582 nfs_mark_request_dirty(req); 1582 nfs_mark_request_dirty(req);
1583 set_bit(NFS_CONTEXT_RESEND_WRITES, &req->wb_context->flags);
1583 next: 1584 next:
1584 nfs_unlock_and_release_request(req); 1585 nfs_unlock_and_release_request(req);
1585 } 1586 }