[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20090320224458.GC4559@mit.edu>
Date: Fri, 20 Mar 2009 18:44:58 -0400
From: Theodore Tso <tytso@....edu>
To: Peter Zijlstra <peterz@...radead.org>,
linux-kernel@...r.kernel.org, Greg Kroah-Hartman <gregkh@...e.de>,
Kay Sievers <kay.sievers@...y.org>
Subject: Re: Lockdep problem involving sysfs_mutex in ext4 in linux-next
On Fri, Mar 20, 2009 at 06:25:22PM -0400, Theodore Tso wrote:
> So if I'm reading this right, the problem is happening because
> someplace in the kernel, fs/sysfs code is grabbing mmap_sem while it
> is holding sysfs_mutex, right? But I can't see where that might be
> happening...
Never mind, I see it. sysfs_readdir() calls filldir() while holding
sysfs_mutex, and filldir() in turn calls copy_to_user(), which can
grab mmap_sem.
The problem is that in other code paths, mmap_sem() is grabbed while
we grab inode->i_alloc_sem() (in ext4_page_mkwrite), and that in turns
has a dependency on jbd2_handle, which has a dependency on s_lock, and
hence lock_super(). Ugh. What a mess.
- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists