]> git.hungrycats.org Git - linux/commitdiff
[PATCH] JBD: fix assertion failure
authorAndrew Morton <akpm@osdl.org>
Sun, 9 Nov 2003 23:18:35 +0000 (15:18 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Sun, 9 Nov 2003 23:18:35 +0000 (15:18 -0800)
This fixes a JBD assertion failure (goes BUG) in __journal_remove_journal_head().

When the journal had aborted due to earlier internal consistency errors (or
I/O errors) it is possible that we free journal_heads which still have
attached copyout buffers.  So just free them up.

fs/jbd/journal.c

index 9f88325e2a408d57f29e3f5857b98ee13d6f810f..7550f31d02492e23bbb3e2ad809d1704319a00f0 100644 (file)
@@ -1729,8 +1729,18 @@ static void __journal_remove_journal_head(struct buffer_head *bh)
                        J_ASSERT_BH(bh, buffer_jbd(bh));
                        J_ASSERT_BH(bh, jh2bh(jh) == bh);
                        BUFFER_TRACE(bh, "remove journal_head");
-                       J_ASSERT_BH(bh, !jh->b_frozen_data);
-                       J_ASSERT_BH(bh, !jh->b_committed_data);
+                       if (jh->b_frozen_data) {
+                               printk(KERN_WARNING "%s: freeing "
+                                               "b_frozen_data\n",
+                                               __FUNCTION__);
+                               kfree(jh->b_frozen_data);
+                       }
+                       if (jh->b_committed_data) {
+                               printk(KERN_WARNING "%s: freeing "
+                                               "b_committed_data\n",
+                                               __FUNCTION__);
+                               kfree(jh->b_committed_data);
+                       }
                        bh->b_private = NULL;
                        jh->b_bh = NULL;        /* debug, really */
                        clear_buffer_jbd(bh);