summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2006-11-15 17:31:56 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-12-06 10:46:28 -0500
commite8e058e830f46a76f837522e5e2df46d4303111f (patch)
tree3d6b6e1efcab646902caf4322c277c82577a3a60
parentcf1308ff7829017dab0dbcc817c63dc9c212923e (diff)
NFS: Fix nfs_sync_inode_wait(FLUSH_INVALIDATE)
Currently nfs_sync_inode_wait() will fail to loop correctly when we call nfs_sync_inode_wait with the FLUSH_INVALIDATE argument. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/write.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 29d88209199d..9b8eb9373ad4 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -1525,9 +1525,10 @@ int nfs_sync_inode_wait(struct inode *inode, unsigned long idx_start,
pages = nfs_scan_dirty(inode, &head, idx_start, npages);
if (pages != 0) {
spin_unlock(&nfsi->req_lock);
- if (how & FLUSH_INVALIDATE)
+ if (how & FLUSH_INVALIDATE) {
nfs_cancel_dirty_list(&head);
- else
+ ret = pages;
+ } else
ret = nfs_flush_list(inode, &head, pages, how);
spin_lock(&nfsi->req_lock);
continue;
@@ -1540,6 +1541,7 @@ int nfs_sync_inode_wait(struct inode *inode, unsigned long idx_start,
if (how & FLUSH_INVALIDATE) {
spin_unlock(&nfsi->req_lock);
nfs_cancel_commit_list(&head);
+ ret = pages;
spin_lock(&nfsi->req_lock);
continue;
}