diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-10-20 02:28:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-20 13:26:39 -0400 |
commit | cd9ae2b6a75bb1fa0d370929c2d7a7da1ed719d9 (patch) | |
tree | 1bf943b54f47bfbf5198b08b930bd09099ff99b7 /fs/nfs/dir.c | |
parent | 13bbc06af8a5f65df0f888b442e557c617cadba7 (diff) |
[PATCH] NFS: Deal with failure of invalidate_inode_pages2()
If invalidate_inode_pages2() fails, then it should in principle just be
because the current process was signalled. In that case, we just want to
ensure that the inode's page cache remains marked as invalid.
Also add a helper to allow the O_DIRECT code to simply mark the page cache as
invalid once it is finished writing, instead of calling
invalidate_inode_pages2() itself.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/nfs/dir.c')
-rw-r--r-- | fs/nfs/dir.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 481f8892a919..58d44057813e 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
@@ -203,8 +203,10 @@ int nfs_readdir_filler(nfs_readdir_descriptor_t *desc, struct page *page) | |||
203 | * Note: assumes we have exclusive access to this mapping either | 203 | * Note: assumes we have exclusive access to this mapping either |
204 | * through inode->i_mutex or some other mechanism. | 204 | * through inode->i_mutex or some other mechanism. |
205 | */ | 205 | */ |
206 | if (page->index == 0) | 206 | if (page->index == 0 && invalidate_inode_pages2_range(inode->i_mapping, PAGE_CACHE_SIZE, -1) < 0) { |
207 | invalidate_inode_pages2_range(inode->i_mapping, PAGE_CACHE_SIZE, -1); | 207 | /* Should never happen */ |
208 | nfs_zap_mapping(inode, inode->i_mapping); | ||
209 | } | ||
208 | unlock_page(page); | 210 | unlock_page(page); |
209 | return 0; | 211 | return 0; |
210 | error: | 212 | error: |