public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Josef Bacik <josef@redhat.com>
To: Eric Sandeen <sandeen@redhat.com>
Cc: Josef Bacik <josef@redhat.com>, linux-ext4@vger.kernel.org
Subject: Re: [PATCH] Ext4: wait for log to commit when putting super
Date: Mon, 7 Dec 2009 15:31:56 -0500	[thread overview]
Message-ID: <20091207203156.GC8558@localhost.localdomain> (raw)
In-Reply-To: <4B1D64ED.5060403@redhat.com>

On Mon, Dec 07, 2009 at 02:26:21PM -0600, Eric Sandeen wrote:
> Josef Bacik wrote:
> > There is a problem where a transaction will be committing while we're unmounting
> > the filesystem and you will get a panic because EXT4_SB(sb)->s_group_info has
> > been kfree'ed in ext4_put_super.  The commit code does the callback for the
> > mballoc stuff to release free'ed blocks in the transaction and panic's trying to
> > access s_group_info.  The fix is to wait for the transaction to finish
> > committing before we start cleaning up the mballoc stuff.  This patch hasn't
> > been tested yet, but its an obvious fix.
> 
> Hm, doesn't jbd2_journal_destroy already do that, but we just
> call it -after- we've done ext4_mb_release which leads to freeing
> EXT4_SB(sb)->s_group_info ?
> 
> Can we just do jbd2_journal_destroy() earlier before we tear
> down things it may depend on?
> 

That seems reasonable.  We do

        ext4_release_system_zone(sb);
        ext4_mb_release(sb);
        ext4_ext_release(sb);
        ext4_xattr_put_super(sb);

before the journal_destroy, and all thats doing is cleaning up our internal
stuff.  If we want to keep it close to what ext3 does we can just move

        ext4_release_system_zone(sb);
        ext4_mb_release(sb);
        ext4_ext_release(sb);

under the journal_destroy or just move the journal destroy above all of that
stuff.  Whichever you prefer.  Thanks,

Josef

  reply	other threads:[~2009-12-07 20:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-07 20:09 [PATCH] Ext4: wait for log to commit when putting super Josef Bacik
2009-12-07 20:26 ` Eric Sandeen
2009-12-07 20:31   ` Josef Bacik [this message]
2009-12-07 20:39     ` Eric Sandeen
2009-12-07 20:41       ` tytso

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=20091207203156.GC8558@localhost.localdomain \
    --to=josef@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=sandeen@redhat.com \
    /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