Re: lockdep wierdness...

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Trond Myklebust <Trond.Myklebust@...>
Cc: Andrew Morton <akpm@...>, Ingo Molnar <mingo@...>, <linux-kernel@...>
Date: Monday, September 24, 2007 - 10:13 pm

On Mon, Sep 24, 2007 at 06:07:38PM -0400, Trond Myklebust wrote:

Actually this can probably happen just on NFS alone.



The circular lock seems to be this:

#1:

  sys_mmap2:              down_write(&mm->mmap_sem);
  nfs_revalidate_mapping: mutex_lock(&inode->i_mutex);


#0:

  vfs_readdir:     mutex_lock(&inode->i_mutex);
   - during the readdir (filldir64), we take a user fault (missing page?)
    and call do_page_fault -
  do_page_fault:   down_read(&mm->mmap_sem);


So it does indeed look like a circular locking. Now the question is, "is
this a bug?".  Looking like the inode of #1 must be a file or something
else that you can mmap and the inode of #0 seems it must be a directory.
I would say "no".

Now if you can readdir on a file or mmap a directory, then this could be
an issue.

Otherwise, I'd love to see someone teach lockdep about this issue! ;-)

-- Steve


-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
lockdep wierdness..., Trond Myklebust, (Mon Sep 24, 6:07 pm)
Re: lockdep wierdness..., Steven Rostedt, (Mon Sep 24, 10:13 pm)
Re: lockdep wierdness..., Peter Zijlstra, (Thu Sep 27, 9:51 am)
Re: lockdep wierdness..., Christoph Hellwig, (Thu Sep 27, 10:00 am)
Re: lockdep wierdness..., Peter Zijlstra, (Thu Sep 27, 11:58 am)