From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Jan Kara <jack@suse.cz>
Cc: Josef Bacik <jbacik@redhat.com>, Theodore Tso <tytso@mit.edu>,
Andreas Dilger <adilger@sun.com>, Mingming Cao <cmm@us.ibm.com>,
"linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>
Subject: Re: jbd2_handle and i_data_sem circular locking dependency detected
Date: Tue, 11 Mar 2008 11:15:01 +0530 [thread overview]
Message-ID: <20080311054501.GA7360@skywalker> (raw)
In-Reply-To: <20080310142426.GH24873@duck.suse.cz>
On Mon, Mar 10, 2008 at 03:24:26PM +0100, Jan Kara wrote:
> > This one came up again when i was doing the mmap ENOSPC patch. Now the
> > current code with migrate is taking i_mutex to protech against all
> > writes. But it seems a write to a mmap area mapping a hole can still go
> > through fine. And that path cannot take i_mutex.
> >
> > So i guess the migrate locking need to be fixed. Any suggestion ?
> Hmm, thinking about it a bit more. One possibility is that we could just
> use i_mutex to protect against ordinary writes, and before swapping blocks
> for extents we'd check whether some holes were not filled in the mean time.
> If yes, we can retry the migrate, or fail it and retry later.
> Another possibility would be to make ext4 use page_mkwrite to fill in
> holes. There we could safely acquire i_mutex and be done.
>
page_mkwrite is called with mmap_sem help and we can't take inode->i_mutex
in page_mkwrite. The DIO write have inode->i_mutex -> mmap_sem
locking order.
I "fixed" it by introducing i_migrate_sem
http://article.gmane.org/gmane.comp.file-systems.ext4/5402
-aneesh
prev parent reply other threads:[~2008-03-11 5:45 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-04 10:12 jbd2_handle and i_data_sem circular locking dependency detected Aneesh Kumar K.V
2008-02-04 15:23 ` Josef Bacik
2008-02-04 15:37 ` Aneesh Kumar K.V
2008-02-04 16:31 ` Jan Kara
2008-02-04 17:12 ` Aneesh Kumar K.V
2008-02-04 17:40 ` Jan Kara
2008-02-05 12:23 ` Aneesh Kumar K.V
2008-02-05 13:42 ` Jan Kara
2008-02-05 16:27 ` Aneesh Kumar K.V
2008-02-05 16:34 ` Jan Kara
2008-02-05 20:06 ` Aneesh Kumar K.V
2008-03-05 20:12 ` Aneesh Kumar K.V
2008-03-10 9:37 ` Jan Kara
2008-03-10 14:24 ` Jan Kara
2008-03-11 5:45 ` Aneesh Kumar K.V [this message]
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=20080311054501.GA7360@skywalker \
--to=aneesh.kumar@linux.vnet.ibm.com \
--cc=adilger@sun.com \
--cc=cmm@us.ibm.com \
--cc=jack@suse.cz \
--cc=jbacik@redhat.com \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/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;
as well as URLs for NNTP newsgroup(s).