From: Al Viro <viro@ZenIV.linux.org.uk>
To: Josh Boyer <jwboyer@gmail.com>
Cc: "Justin P. Mattock" <justinmattock@gmail.com>,
Peter Zijlstra <peterz@infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: INFO: possible circular locking dependency detected 3.1.0-rc2-00190-g3210d19
Date: Mon, 22 Aug 2011 14:27:14 +0100 [thread overview]
Message-ID: <20110822132713.GT2203@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20110822131621.GS2203@ZenIV.linux.org.uk>
On Mon, Aug 22, 2011 at 02:16:21PM +0100, Al Viro wrote:
> On Mon, Aug 22, 2011 at 09:09:14AM -0400, Josh Boyer wrote:
>
> > We've had a report of this on 3.0.1 as well. Slightly different
> > scenario and fs, but the locks in question are the same.
> > https://bugzilla.redhat.com/show_bug.cgi?id=730998
> >
> > It seems that with CONFIG_PROVE_LOCKING on, might_fault will always
> > attempt to grab mm->mmap_sem. The common flow here is that getdents
> > calls filldir, which calls copy_to_user, which is what is calling
> > might_fault.
> >
> > Beyond that, I'm a bit over my head at the moment because I don't know
> > if the VFS is right and we just need some more lockdep annotations or
> > if there really is a problem.
>
> Don't grab ->i_mutex in ->evict_inode(). Why are you doing that, anyway?
Note, BTW, that readdir() is a red herring here; there is a much more
relevant reason for that ranking. Namely, write() doing copy_from_user()
when the file we are writing into has i_mutex held by us. That can fault
and in this case we have a non-directory inode. While you can't have
directory mmapped, regular files can be mmapped just fine.
next prev parent reply other threads:[~2011-08-22 13:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-22 3:41 INFO: possible circular locking dependency detected 3.1.0-rc2-00190-g3210d19 Justin P. Mattock
2011-08-22 13:09 ` Josh Boyer
2011-08-22 13:16 ` Al Viro
2011-08-22 13:27 ` Josh Boyer
2011-08-22 13:27 ` Al Viro [this message]
2011-08-22 13:33 ` Josh Boyer
2011-08-22 13:56 ` Al Viro
2011-08-22 15:24 ` Josh Boyer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110822132713.GT2203@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=justinmattock@gmail.com \
--cc=jwboyer@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox