diff options
author | OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> | 2006-10-20 02:29:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-20 13:26:44 -0400 |
commit | 3e2a532b26b491706bd8b5c7cfc8d767b43b8f36 (patch) | |
tree | 641db5da4c1adbeee04ce6594746cec51f581ff0 /fs/jbd2/transaction.c | |
parent | 82591e6ea234762eeaa8b2337fe060ed438c18dc (diff) |
[PATCH] ext3/4: fix J_ASSERT(transaction->t_updates > 0) in journal_stop()
A disk generated some I/O error, after it, I hitted
J_ASSERT(transaction->t_updates > 0) in journal_stop().
It seems to happened on ext3_truncate() path from stack trace. Then,
maybe the following case may trigger J_ASSERT(transaction->t_updates > 0).
ext3_truncate()
-> ext3_free_branches()
-> ext3_journal_test_restart()
-> ext3_journal_restart()
-> journal_restart()
transaction->t_updates--;
/* another process aborted journal */
-> start_this_handle()
returns -EROFS without transaction->t_updates++;
-> ext3_journal_stop()
-> journal_stop()
J_ASSERT(transaction->t_updates > 0)
If journal was aborted in middle of journal_restart(), ext3_truncate()
may trigger J_ASSERT().
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: <linux-ext4@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/jbd2/transaction.c')
-rw-r--r-- | fs/jbd2/transaction.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c index 149957bef907..b6cf2be845a1 100644 --- a/fs/jbd2/transaction.c +++ b/fs/jbd2/transaction.c | |||
@@ -1314,13 +1314,14 @@ int jbd2_journal_stop(handle_t *handle) | |||
1314 | int old_handle_count, err; | 1314 | int old_handle_count, err; |
1315 | pid_t pid; | 1315 | pid_t pid; |
1316 | 1316 | ||
1317 | J_ASSERT(transaction->t_updates > 0); | ||
1318 | J_ASSERT(journal_current_handle() == handle); | 1317 | J_ASSERT(journal_current_handle() == handle); |
1319 | 1318 | ||
1320 | if (is_handle_aborted(handle)) | 1319 | if (is_handle_aborted(handle)) |
1321 | err = -EIO; | 1320 | err = -EIO; |
1322 | else | 1321 | else { |
1322 | J_ASSERT(transaction->t_updates > 0); | ||
1323 | err = 0; | 1323 | err = 0; |
1324 | } | ||
1324 | 1325 | ||
1325 | if (--handle->h_ref > 0) { | 1326 | if (--handle->h_ref > 0) { |
1326 | jbd_debug(4, "h_ref %d -> %d\n", handle->h_ref + 1, | 1327 | jbd_debug(4, "h_ref %d -> %d\n", handle->h_ref + 1, |