diff mbox

ext4 fails on ext2 filesystems

Message ID 20090120145100.GD10037@mit.edu
State Accepted, archived
Headers show

Commit Message

Theodore Ts'o Jan. 20, 2009, 2:51 p.m. UTC
On Sun, Jan 18, 2009 at 11:04:59AM +0100, Jörg Sommer wrote:
> > > [  203.082300] EXT4 FS on hda3, no journal
> > > [  205.746713] EXT4-fs error (device hda3): ext4_free_data: circular indirect block detected, inode=165056, block=184476
> > > 

Hi, this patch should fix your problem.

						- Ted

commit bf3baec2b4529dcf47ee422a48b8c0e83df7f0a0
Author: Theodore Ts'o <tytso@mit.edu>
Date:   Tue Jan 20 09:50:19 2009 -0500

    ext4: Fix ext4_free_blocks() w/o a journal when files have indirect blocks
    
    When trying to unlink a file with indirect blocks on a filesystem
    without a journal, the "circular indirect block" sanity test was
    getting falsely triggered.
    
    Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Jörg Sommer Jan. 21, 2009, 6:45 p.m. UTC | #1
Hi Theodore,

Theodore Tso schrieb am Tue 20. Jan, 09:51 (-0500):
> On Sun, Jan 18, 2009 at 11:04:59AM +0100, Jörg Sommer wrote:
> > > > [  203.082300] EXT4 FS on hda3, no journal
> > > > [  205.746713] EXT4-fs error (device hda3): ext4_free_data: circular indirect block detected, inode=165056, block=184476
> > > > 
> 
> Hi, this patch should fix your problem.

Yes, this patch fixes the problem. Thanks.

> commit bf3baec2b4529dcf47ee422a48b8c0e83df7f0a0
> Author: Theodore Ts'o <tytso@mit.edu>
> Date:   Tue Jan 20 09:50:19 2009 -0500
> 
>     ext4: Fix ext4_free_blocks() w/o a journal when files have indirect blocks
>     
>     When trying to unlink a file with indirect blocks on a filesystem
>     without a journal, the "circular indirect block" sanity test was
>     getting falsely triggered.
>     
>     Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>

Tested-by: Jörg Sommer <joerg@alea.gnuu.de>

> diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
> index 49484ba..b4386da 100644
> --- a/fs/ext4/inode.c
> +++ b/fs/ext4/inode.c
> @@ -3622,7 +3622,7 @@ static void ext4_free_data(handle_t *handle, struct inode *inode,
>  		 * block pointed to itself, it would have been detached when
>  		 * the block was cleared. Check for this instead of OOPSing.
>  		 */
> -		if (bh2jh(this_bh))
> +		if ((EXT4_JOURNAL(inode) == NULL) || bh2jh(this_bh))
>  			ext4_handle_dirty_metadata(handle, inode, this_bh);
>  		else
>  			ext4_error(inode->i_sb, __func__,
> 

Bye, Jörg.
Theodore Ts'o Jan. 21, 2009, 7:58 p.m. UTC | #2
On Wed, Jan 21, 2009 at 07:45:17PM +0100, Jörg Sommer wrote:
> 
> Yes, this patch fixes the problem. Thanks.

Great, thanks for the confirmation.

						- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 49484ba..b4386da 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -3622,7 +3622,7 @@  static void ext4_free_data(handle_t *handle, struct inode *inode,
 		 * block pointed to itself, it would have been detached when
 		 * the block was cleared. Check for this instead of OOPSing.
 		 */
-		if (bh2jh(this_bh))
+		if ((EXT4_JOURNAL(inode) == NULL) || bh2jh(this_bh))
 			ext4_handle_dirty_metadata(handle, inode, this_bh);
 		else
 			ext4_error(inode->i_sb, __func__,