mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-19 13:11:14 +00:00
[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>
This commit is contained in:
parent
bde8f00ce6
commit
717d44e849
4 changed files with 72 additions and 32 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue