linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Ext4: wait for log to commit when putting super
@ 2009-12-07 20:09 Josef Bacik
  2009-12-07 20:26 ` Eric Sandeen
  0 siblings, 1 reply; 5+ messages in thread
From: Josef Bacik @ 2009-12-07 20:09 UTC (permalink / raw)
  To: linux-ext4; +Cc: sandeen

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.

Signed-off-by: Josef Bacik <josef@redhat.com>
---
 fs/ext4/super.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index d4ca92a..ddd115f 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -593,6 +593,7 @@ static void ext4_put_super(struct super_block *sb)
 {
 	struct ext4_sb_info *sbi = EXT4_SB(sb);
 	struct ext4_super_block *es = sbi->s_es;
+	tid_t target;
 	int i, err;
 
 	flush_workqueue(sbi->dio_unwritten_wq);
@@ -603,6 +604,9 @@ static void ext4_put_super(struct super_block *sb)
 	if (sb->s_dirt)
 		ext4_commit_super(sb, 1);
 
+	if (jbd2_journal_start_commit(EXT4_SB(sb)->s_journal, &target))
+		jbd2_log_wait_commit(EXT4_SB(sb)->s_journal, target);
+
 	ext4_release_system_zone(sb);
 	ext4_mb_release(sb);
 	ext4_ext_release(sb);
-- 
1.6.2.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-12-07 20:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2009-12-07 20:39     ` Eric Sandeen
2009-12-07 20:41       ` tytso

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).