diff options
Diffstat (limited to 'fs/ext3/inode.c')
-rw-r--r-- | fs/ext3/inode.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c index 36f74f17a11c..3bf07d70b914 100644 --- a/fs/ext3/inode.c +++ b/fs/ext3/inode.c | |||
@@ -2127,7 +2127,21 @@ static void ext3_free_data(handle_t *handle, struct inode *inode, | |||
2127 | 2127 | ||
2128 | if (this_bh) { | 2128 | if (this_bh) { |
2129 | BUFFER_TRACE(this_bh, "call ext3_journal_dirty_metadata"); | 2129 | BUFFER_TRACE(this_bh, "call ext3_journal_dirty_metadata"); |
2130 | ext3_journal_dirty_metadata(handle, this_bh); | 2130 | |
2131 | /* | ||
2132 | * The buffer head should have an attached journal head at this | ||
2133 | * point. However, if the data is corrupted and an indirect | ||
2134 | * block pointed to itself, it would have been detached when | ||
2135 | * the block was cleared. Check for this instead of OOPSing. | ||
2136 | */ | ||
2137 | if (bh2jh(this_bh)) | ||
2138 | ext3_journal_dirty_metadata(handle, this_bh); | ||
2139 | else | ||
2140 | ext3_error(inode->i_sb, "ext3_free_data", | ||
2141 | "circular indirect block detected, " | ||
2142 | "inode=%lu, block=%llu", | ||
2143 | inode->i_ino, | ||
2144 | (unsigned long long)this_bh->b_blocknr); | ||
2131 | } | 2145 | } |
2132 | } | 2146 | } |
2133 | 2147 | ||