Skip to content

Commit 235d680

Browse files
zhangyi089tytso
authored andcommitted
jbd2: don't abort the journal when freeing buffers
Now that we can be sure the journal is aborted once a buffer has failed to be written back to disk, we can remove the journal abort logic in jbd2_journal_try_to_free_buffers() which was introduced in commit c044f3d ("jbd2: abort journal if free a async write error metadata buffer"), because it may cost and propably is not safe. Signed-off-by: Zhang Yi <[email protected]> Reviewed-by: Jan Kara <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent fcf3754 commit 235d680

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

fs/jbd2/transaction.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2123,7 +2123,6 @@ int jbd2_journal_try_to_free_buffers(journal_t *journal, struct page *page)
21232123
{
21242124
struct buffer_head *head;
21252125
struct buffer_head *bh;
2126-
bool has_write_io_error = false;
21272126
int ret = 0;
21282127

21292128
J_ASSERT(PageLocked(page));
@@ -2148,26 +2147,10 @@ int jbd2_journal_try_to_free_buffers(journal_t *journal, struct page *page)
21482147
jbd2_journal_put_journal_head(jh);
21492148
if (buffer_jbd(bh))
21502149
goto busy;
2151-
2152-
/*
2153-
* If we free a metadata buffer which has been failed to
2154-
* write out, the jbd2 checkpoint procedure will not detect
2155-
* this failure and may lead to filesystem inconsistency
2156-
* after cleanup journal tail.
2157-
*/
2158-
if (buffer_write_io_error(bh)) {
2159-
pr_err("JBD2: Error while async write back metadata bh %llu.",
2160-
(unsigned long long)bh->b_blocknr);
2161-
has_write_io_error = true;
2162-
}
21632150
} while ((bh = bh->b_this_page) != head);
21642151

21652152
ret = try_to_free_buffers(page);
2166-
21672153
busy:
2168-
if (has_write_io_error)
2169-
jbd2_journal_abort(journal, -EIO);
2170-
21712154
return ret;
21722155
}
21732156

0 commit comments

Comments
 (0)