Commit 046527de authored by Stephen C. Tweedie's avatar Stephen C. Tweedie Committed by Linus Torvalds

[PATCH] ext3: cleanup handling of aborted transactions.

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: default avatarStephen Tweedie <sct@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 80ddd72d
...@@ -108,14 +108,19 @@ void ext3_journal_abort_handle(const char *caller, const char *err_fn, ...@@ -108,14 +108,19 @@ void ext3_journal_abort_handle(const char *caller, const char *err_fn,
char nbuf[16]; char nbuf[16];
const char *errstr = ext3_decode_error(NULL, err, nbuf); const char *errstr = ext3_decode_error(NULL, err, nbuf);
printk(KERN_ERR "%s: aborting transaction: %s in %s",
caller, errstr, err_fn);
if (bh) if (bh)
BUFFER_TRACE(bh, "abort"); BUFFER_TRACE(bh, "abort");
journal_abort_handle(handle);
if (!handle->h_err) if (!handle->h_err)
handle->h_err = 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 /* Deal with the reporting of failure conditions on a filesystem such as
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment