[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:
committed by
Linus Torvalds
parent
bde8f00ce6
commit
717d44e849
@ -532,7 +532,7 @@ static int nfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
|
||||
|
||||
lock_kernel();
|
||||
|
||||
res = nfs_revalidate_mapping(inode, filp->f_mapping);
|
||||
res = nfs_revalidate_mapping_nolock(inode, filp->f_mapping);
|
||||
if (res < 0) {
|
||||
unlock_kernel();
|
||||
return res;
|
||||
|
Reference in New Issue
Block a user