diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2007-01-24 14:54:55 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-01-24 15:31:06 -0500 |
commit | 717d44e849219781ced028a40fcc59d3e1f49e4c (patch) | |
tree | aa34a9b84377d18ff58901cc342b84c7e8b81dca /fs/nfs/dir.c | |
parent | bde8f00ce64d9824a4f227c8594e335a1a10d044 (diff) |
[PATCH] NFS: Fix races in nfs_revalidate_mapping()
Prevent the call to invalidate_inode_pages2() from racing with file writes
by taking the inode->i_mutex across the page cache flush and invalidate.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/nfs/dir.c')
-rw-r--r-- | fs/nfs/dir.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index dee3d6c0f194..d9ba8cb0ee75 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
@@ -532,7 +532,7 @@ static int nfs_readdir(struct file *filp, void *dirent, filldir_t filldir) | |||
532 | 532 | ||
533 | lock_kernel(); | 533 | lock_kernel(); |
534 | 534 | ||
535 | res = nfs_revalidate_mapping(inode, filp->f_mapping); | 535 | res = nfs_revalidate_mapping_nolock(inode, filp->f_mapping); |
536 | if (res < 0) { | 536 | if (res < 0) { |
537 | unlock_kernel(); | 537 | unlock_kernel(); |
538 | return res; | 538 | return res; |