From 717d44e849219781ced028a40fcc59d3e1f49e4c Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Wed, 24 Jan 2007 11:54:55 -0800 Subject: [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 Signed-off-by: Linus Torvalds --- fs/nfs/symlink.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'fs/nfs/symlink.c') diff --git a/fs/nfs/symlink.c b/fs/nfs/symlink.c index 6c68611..525c136 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) { struct inode *inode = dentry->d_inode; struct page *page; - void *err = ERR_PTR(nfs_revalidate_mapping(inode, inode->i_mapping)); + void *err; + + err = ERR_PTR(nfs_revalidate_mapping_nolock(inode, inode->i_mapping)); if (err) goto read_failed; page = read_cache_page(&inode->i_data, 0, -- cgit v1.1