diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-04-09 19:07:07 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-04-09 19:08:17 -0400 |
commit | b80c3cb628f0ebc241b02e38dd028969fb8026a2 (patch) | |
tree | 12b0b9a7d8c4dbac5ab17b5cef9f3d5e32df16b1 /fs/nfs | |
parent | 1544fa0f7a46241582abc48f07b74f3d846379e4 (diff) |
NFS: Ensure that writeback_single_inode() calls write_inode() when syncing
Since writeback_single_inode() checks the inode->i_state flags _before_ it
flushes out the data, we need to ensure that the I_DIRTY_DATASYNC flag is
already set. Otherwise we risk not seeing a call to write_inode(), which
again means that we break fsync() et al...
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/write.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 53ff70e23993..7f40ea305543 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
@@ -421,6 +421,7 @@ static void | |||
421 | nfs_mark_request_dirty(struct nfs_page *req) | 421 | nfs_mark_request_dirty(struct nfs_page *req) |
422 | { | 422 | { |
423 | __set_page_dirty_nobuffers(req->wb_page); | 423 | __set_page_dirty_nobuffers(req->wb_page); |
424 | __mark_inode_dirty(req->wb_page->mapping->host, I_DIRTY_DATASYNC); | ||
424 | } | 425 | } |
425 | 426 | ||
426 | #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) | 427 | #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) |
@@ -660,6 +661,7 @@ static int nfs_writepage_setup(struct nfs_open_context *ctx, struct page *page, | |||
660 | req = nfs_setup_write_request(ctx, page, offset, count); | 661 | req = nfs_setup_write_request(ctx, page, offset, count); |
661 | if (IS_ERR(req)) | 662 | if (IS_ERR(req)) |
662 | return PTR_ERR(req); | 663 | return PTR_ERR(req); |
664 | nfs_mark_request_dirty(req); | ||
663 | /* Update file length */ | 665 | /* Update file length */ |
664 | nfs_grow_file(page, offset, count); | 666 | nfs_grow_file(page, offset, count); |
665 | nfs_mark_uptodate(page, req->wb_pgbase, req->wb_bytes); | 667 | nfs_mark_uptodate(page, req->wb_pgbase, req->wb_bytes); |
@@ -739,8 +741,6 @@ int nfs_updatepage(struct file *file, struct page *page, | |||
739 | status = nfs_writepage_setup(ctx, page, offset, count); | 741 | status = nfs_writepage_setup(ctx, page, offset, count); |
740 | if (status < 0) | 742 | if (status < 0) |
741 | nfs_set_pageerror(page); | 743 | nfs_set_pageerror(page); |
742 | else | ||
743 | __set_page_dirty_nobuffers(page); | ||
744 | 744 | ||
745 | dprintk("NFS: nfs_updatepage returns %d (isize %lld)\n", | 745 | dprintk("NFS: nfs_updatepage returns %d (isize %lld)\n", |
746 | status, (long long)i_size_read(inode)); | 746 | status, (long long)i_size_read(inode)); |