From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Josef Bacik <jbacik@redhat.com>
Cc: Jan Kara <jack@suse.cz>, 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: Mon, 4 Feb 2008 21:07:45 +0530 [thread overview]
Message-ID: <20080204153745.GA6798@skywalker> (raw)
In-Reply-To: <200802041023.16998.jbacik@redhat.com>
On Mon, Feb 04, 2008 at 10:23:16AM -0500, Josef Bacik wrote:
> On Monday 04 February 2008 5:12:28 am Aneesh Kumar K.V wrote:
> > Hi,
> >
> > This is with the new ext3 -> ext4 migrate code added. The recently added
> > lockdep for jbd2 helped to find this out. We want to hold the i_data_sem
> > on the ext3 inode during migration to prevent walking the ext3 inode
> > when it is being converted to ext4 format. Also we want to avoid
> > file truncation and new blocks being added while converting to ext4.
> > Also we dont want to reserve large number of credits for journal.
> > Any idea how to fix this ?
> >
>
> Hello,
>
> Seems you should be taking the i_data_sem after starting the journal in
> ext4_ext_migrate. I haven't looked at this stuff too much, but everywhere I
> see i_data_sem taken its within a journal_start/journal_stop. Here's the
> patch. Let me know if I'm way off btw, like I said I'm new to this :). Thank
> you,
But that doesn't help. Because we call ext4_journal_restart after taking
i_data_sem. That implies we can sleep waiting for other running
transaction to commit. And if that transaction (in the above example
rm) is waiting for i_data_sem we deadlock.
-aneesh
next prev parent reply other threads:[~2008-02-04 15:37 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 [this message]
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
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=20080204153745.GA6798@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).