Commit 2caed7c7 authored by Matt Mackall's avatar Matt Mackall Committed by Linus Torvalds

[PATCH] vprintk for ext3 errors

Kill error_buf madness in ext3
Signed-off-by: default avatarMatt Mackall <mpm@selenic.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 168c1601
...@@ -118,8 +118,6 @@ void ext3_journal_abort_handle(const char *caller, const char *err_fn, ...@@ -118,8 +118,6 @@ void ext3_journal_abort_handle(const char *caller, const char *err_fn,
handle->h_err = err; handle->h_err = err;
} }
static char error_buf[1024];
/* Deal with the reporting of failure conditions on a filesystem such as /* Deal with the reporting of failure conditions on a filesystem such as
* inconsistencies detected or read IO failures. * inconsistencies detected or read IO failures.
* *
...@@ -166,12 +164,11 @@ void ext3_error (struct super_block * sb, const char * function, ...@@ -166,12 +164,11 @@ void ext3_error (struct super_block * sb, const char * function,
{ {
va_list args; va_list args;
va_start (args, fmt); va_start(args, fmt);
vsprintf (error_buf, fmt, args); printk(KERN_CRIT "EXT3-fs error (device %s): %s: ",sb->s_id, function);
va_end (args); vprintk(fmt, args);
printk("\n");
printk (KERN_CRIT "EXT3-fs error (device %s): %s: %s\n", va_end(args);
sb->s_id, function, error_buf);
ext3_handle_error(sb); ext3_handle_error(sb);
} }
...@@ -240,21 +237,19 @@ void ext3_abort (struct super_block * sb, const char * function, ...@@ -240,21 +237,19 @@ void ext3_abort (struct super_block * sb, const char * function,
printk (KERN_CRIT "ext3_abort called.\n"); printk (KERN_CRIT "ext3_abort called.\n");
va_start (args, fmt); va_start(args, fmt);
vsprintf (error_buf, fmt, args); printk(KERN_CRIT "EXT3-fs error (device %s): %s: ",sb->s_id, function);
va_end (args); vprintk(fmt, args);
printk("\n");
va_end(args);
if (test_opt (sb, ERRORS_PANIC)) if (test_opt(sb, ERRORS_PANIC))
panic ("EXT3-fs panic (device %s): %s: %s\n", panic("EXT3-fs panic from previous error\n");
sb->s_id, function, error_buf);
printk (KERN_CRIT "EXT3-fs abort (device %s): %s: %s\n",
sb->s_id, function, error_buf);
if (sb->s_flags & MS_RDONLY) if (sb->s_flags & MS_RDONLY)
return; return;
printk (KERN_CRIT "Remounting filesystem read-only\n"); printk(KERN_CRIT "Remounting filesystem read-only\n");
EXT3_SB(sb)->s_mount_state |= EXT3_ERROR_FS; EXT3_SB(sb)->s_mount_state |= EXT3_ERROR_FS;
sb->s_flags |= MS_RDONLY; sb->s_flags |= MS_RDONLY;
EXT3_SB(sb)->s_mount_opt |= EXT3_MOUNT_ABORT; EXT3_SB(sb)->s_mount_opt |= EXT3_MOUNT_ABORT;
...@@ -272,15 +267,16 @@ NORET_TYPE void ext3_panic (struct super_block * sb, const char * function, ...@@ -272,15 +267,16 @@ NORET_TYPE void ext3_panic (struct super_block * sb, const char * function,
{ {
va_list args; va_list args;
va_start (args, fmt); va_start(args, fmt);
vsprintf (error_buf, fmt, args); printk(KERN_CRIT "EXT3-fs error (device %s): %s: ",sb->s_id, function);
va_end (args); vprintk(fmt, args);
printk("\n");
va_end(args);
/* this is to prevent panic from syncing this filesystem */ /* this is to prevent panic from syncing this filesystem */
/* AKPM: is this sufficient? */ /* AKPM: is this sufficient? */
sb->s_flags |= MS_RDONLY; sb->s_flags |= MS_RDONLY;
panic ("EXT3-fs panic (device %s): %s: %s\n", panic ("EXT3-fs panic forced\n");
sb->s_id, function, error_buf);
} }
void ext3_warning (struct super_block * sb, const char * function, void ext3_warning (struct super_block * sb, const char * function,
...@@ -288,11 +284,12 @@ void ext3_warning (struct super_block * sb, const char * function, ...@@ -288,11 +284,12 @@ void ext3_warning (struct super_block * sb, const char * function,
{ {
va_list args; va_list args;
va_start (args, fmt); va_start(args, fmt);
vsprintf (error_buf, fmt, args); printk(KERN_WARNING "EXT3-fs warning (device %s): %s: ",
va_end (args); sb->s_id, function);
printk (KERN_WARNING "EXT3-fs warning (device %s): %s: %s\n", vprintk(fmt, args);
sb->s_id, function, error_buf); printk("\n");
va_end(args);
} }
void ext3_update_dynamic_rev(struct super_block *sb) void ext3_update_dynamic_rev(struct super_block *sb)
......
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