diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-11-15 17:31:56 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-12-06 10:46:28 -0500 |
commit | e8e058e830f46a76f837522e5e2df46d4303111f (patch) | |
tree | 3d6b6e1efcab646902caf4322c277c82577a3a60 /fs/nfs | |
parent | cf1308ff7829017dab0dbcc817c63dc9c212923e (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>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/write.c | 6 |
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, | |||
1525 | pages = nfs_scan_dirty(inode, &head, idx_start, npages); | 1525 | pages = nfs_scan_dirty(inode, &head, idx_start, npages); |
1526 | if (pages != 0) { | 1526 | if (pages != 0) { |
1527 | spin_unlock(&nfsi->req_lock); | 1527 | spin_unlock(&nfsi->req_lock); |
1528 | if (how & FLUSH_INVALIDATE) | 1528 | if (how & FLUSH_INVALIDATE) { |
1529 | nfs_cancel_dirty_list(&head); | 1529 | nfs_cancel_dirty_list(&head); |
1530 | else | 1530 | ret = pages; |
1531 | } else | ||
1531 | ret = nfs_flush_list(inode, &head, pages, how); | 1532 | ret = nfs_flush_list(inode, &head, pages, how); |
1532 | spin_lock(&nfsi->req_lock); | 1533 | spin_lock(&nfsi->req_lock); |
1533 | continue; | 1534 | continue; |
@@ -1540,6 +1541,7 @@ int nfs_sync_inode_wait(struct inode *inode, unsigned long idx_start, | |||
1540 | if (how & FLUSH_INVALIDATE) { | 1541 | if (how & FLUSH_INVALIDATE) { |
1541 | spin_unlock(&nfsi->req_lock); | 1542 | spin_unlock(&nfsi->req_lock); |
1542 | nfs_cancel_commit_list(&head); | 1543 | nfs_cancel_commit_list(&head); |
1544 | ret = pages; | ||
1543 | spin_lock(&nfsi->req_lock); | 1545 | spin_lock(&nfsi->req_lock); |
1544 | continue; | 1546 | continue; |
1545 | } | 1547 | } |