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/symlink.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/symlink.c')
-rw-r--r-- | fs/nfs/symlink.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/nfs/symlink.c b/fs/nfs/symlink.c index 6c686112cc03..525c136c7d8c 100644 --- a/fs/nfs/symlink.c +++ b/fs/nfs/symlink.c | |||
@@ -50,7 +50,9 @@ static void *nfs_follow_link(struct dentry *dentry, struct nameidata *nd) | |||
50 | { | 50 | { |
51 | struct inode *inode = dentry->d_inode; | 51 | struct inode *inode = dentry->d_inode; |
52 | struct page *page; | 52 | struct page *page; |
53 | void *err = ERR_PTR(nfs_revalidate_mapping(inode, inode->i_mapping)); | 53 | void *err; |
54 | |||
55 | err = ERR_PTR(nfs_revalidate_mapping_nolock(inode, inode->i_mapping)); | ||
54 | if (err) | 56 | if (err) |
55 | goto read_failed; | 57 | goto read_failed; |
56 | page = read_cache_page(&inode->i_data, 0, | 58 | page = read_cache_page(&inode->i_data, 0, |