lkml.org 
[lkml]   [2009]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: NFS lockdep lock misordering mmap_sem<->i_mutex_key with 2.6.32-git1
On Tue, Dec 15, 2009 at 06:54:37PM -0500, Trond Myklebust wrote:

> > nfs_revalidate_mapping takes i_mutex, but mmap already has mmap_sem
> > hold and taking i_mutex inside mmap_sem is not allowed by the VFS.

VM, actually...

> If you want to work around the problem rather than going for something
> like Peter's split up of the mmap() callback, then I'd suggest changing
> to using nfs_revalidate_mapping_nolock() instead. The fact that we are
> seeing these lock misordering warnings is proof that the call to
> nfs_revalidate_mapping() is not always a no-op.
>
> By not taking the i_mutex your call to invalidate_inode_pages2() can
> potentially end up racing with another process that is writing to the
> file, but that should be a rare occurrence. The effect will be that the
> two processes can end up fighting to alternatively dirty and then clean
> the pages...

Um... The really interesting question is whether it's a false positive;
*can* we hit the deadlock here? getdents() is a red herring; write() and
truncate() are real candidates.

What happens if we have one thread do mmap() while another (sharing the
address space with it) does write() or truncate() on the same file?


\
 
 \ /
  Last update: 2009-12-16 01:13    [W:0.065 / U:0.616 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site