From: Stephen Tweedie This patch improves ext3's error logging when we encounter an on-disk corruption. Previously, a transaction (such as a truncate) which encountered many corruptions (eg. a single highly-corrupt indirect block) would emit copious "aborting transaction" errors to the log. Even worse, encountering an aborted journal can count as such an error, leading to a flood of spurious "aborting transaction: Journal has aborted" errors. With the fix, only emit that message on the first error. The patch also restores a missing \n in that printk path. Signed-off-by: Stephen Tweedie Signed-off-by: Andrew Morton --- 25-akpm/fs/ext3/super.c | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) diff -puN fs/ext3/super.c~ext3-cleanup-handling-of-aborted-transactions fs/ext3/super.c --- 25/fs/ext3/super.c~ext3-cleanup-handling-of-aborted-transactions Fri Nov 19 16:22:42 2004 +++ 25-akpm/fs/ext3/super.c Fri Nov 19 16:22:42 2004 @@ -108,14 +108,19 @@ void ext3_journal_abort_handle(const cha char nbuf[16]; const char *errstr = ext3_decode_error(NULL, err, nbuf); - printk(KERN_ERR "%s: aborting transaction: %s in %s", - caller, errstr, err_fn); - if (bh) BUFFER_TRACE(bh, "abort"); - journal_abort_handle(handle); + if (!handle->h_err) handle->h_err = err; + + if (is_handle_aborted(handle)) + return; + + printk(KERN_ERR "%s: aborting transaction: %s in %s\n", + caller, errstr, err_fn); + + journal_abort_handle(handle); } /* Deal with the reporting of failure conditions on a filesystem such as _