diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-01-03 09:55:02 +0100 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-01-06 14:58:39 -0500 |
commit | abd3e641d5ef9f836ab2f2b04d80b8619b051531 (patch) | |
tree | 053c82b4c23a5fb419691154879acff3f487923b /fs/nfs/write.c | |
parent | 22905f775dd6a8b73be99826dcad07ceec00244b (diff) | |
download | kernel_samsung_crespo-abd3e641d5ef9f836ab2f2b04d80b8619b051531.zip kernel_samsung_crespo-abd3e641d5ef9f836ab2f2b04d80b8619b051531.tar.gz kernel_samsung_crespo-abd3e641d5ef9f836ab2f2b04d80b8619b051531.tar.bz2 |
NFS: Work correctly with single-page ->writepage() calls
Ensure that we always initiate flushing of data before we exit
a single-page ->writepage() call.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r-- | fs/nfs/write.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 3107908..95d00f9 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -232,19 +232,16 @@ static int nfs_writepage_async(struct nfs_open_context *ctx, unsigned int offset, unsigned int count) { struct nfs_page *req; - int status; req = nfs_update_request(ctx, inode, page, offset, count); - status = (IS_ERR(req)) ? PTR_ERR(req) : 0; - if (status < 0) - goto out; + if (IS_ERR(req)) + return PTR_ERR(req); /* Update file length */ nfs_grow_file(page, offset, count); /* Set the PG_uptodate flag? */ nfs_mark_uptodate(page, offset, count); nfs_unlock_request(req); - out: - return status; + return 0; } static int wb_priority(struct writeback_control *wbc) @@ -304,11 +301,8 @@ do_it: lock_kernel(); if (!IS_SYNC(inode) && inode_referenced) { err = nfs_writepage_async(ctx, inode, page, 0, offset); - if (err >= 0) { - err = 0; - if (wbc->for_reclaim) - nfs_flush_inode(inode, 0, 0, FLUSH_STABLE); - } + if (!wbc->for_writepages) + nfs_flush_inode(inode, 0, 0, wb_priority(wbc)); } else { err = nfs_writepage_sync(ctx, inode, page, 0, offset, priority); |