]> git.hungrycats.org Git - linux/commitdiff
[PATCH] fix ReiserFS metadata journalling
authorHans Reiser <reiser@namesys.com>
Wed, 10 Apr 2002 06:44:15 +0000 (23:44 -0700)
committerLinus Torvalds <torvalds@penguin.transmeta.com>
Wed, 10 Apr 2002 06:44:15 +0000 (23:44 -0700)
This patch is to add forgotten metadata journaling for a case when
we free blocks after tail conversion failures. Found and fixed by Chris Mason

fs/reiserfs/inode.c

index 229403225c14a50e13f0ce7653d06fbef1503f47..3c69d5078903c7df763b85c862c46f9a1ddada1a 100644 (file)
@@ -745,8 +745,12 @@ int reiserfs_get_block (struct inode * inode, sector_t block,
                if (retval) {
                    if ( retval != -ENOSPC )
                        printk("clm-6004: convert tail failed inode %lu, error %d\n", inode->i_ino, retval) ;
-                   if (allocated_block_nr)
+                   if (allocated_block_nr) {
+                       /* the bitmap, the super, and the stat data == 3 */
+                       journal_begin(&th, inode->i_sb, 3) ;
                        reiserfs_free_block (&th, allocated_block_nr);
+                       transaction_started = 1 ;
+                   }
                    goto failure ;
                }
                goto research ;