[PATCH 2/3] vprintk for ext2 errors
From: Matt Mackall (mpm_at_selenic.com)
Date: 07/31/04
- Previous message: Felipe Alfaro Solana: "Re: [patch] voluntary-preempt-2.6.8-rc2-L2 PS2 keyboard gone south"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 30 Jul 2004 20:38:26 -0500 To: linux-kernel <linux-kernel@vger.kernel.org>, Andrew Morton <akpm@osdl.org>
Kill error_buf madness in ext2
Signed-off-by: Matt Mackall <mpm@selenic.com>
tiny-mpm/fs/ext2/super.c | 45 +++++++++++++++++++++++----------------------
1 files changed, 23 insertions(+), 22 deletions(-)
diff -puN fs/ext2/super.c~kill-ext2-error-buff fs/ext2/super.c
--- tiny/fs/ext2/super.c~kill-ext2-error-buff 2004-03-20 12:14:47.000000000 -0600
+++ tiny-mpm/fs/ext2/super.c 2004-03-20 12:14:47.000000000 -0600
@@ -37,8 +37,6 @@ static void ext2_sync_super(struct super
static int ext2_remount (struct super_block * sb, int * flags, char * data);
static int ext2_statfs (struct super_block * sb, struct kstatfs * buf);
-static char error_buf[1024];
-
void ext2_error (struct super_block * sb, const char * function,
const char * fmt, ...)
{
@@ -52,16 +50,17 @@ void ext2_error (struct super_block * sb
cpu_to_le16(le16_to_cpu(es->s_state) | EXT2_ERROR_FS);
ext2_sync_super(sb, es);
}
- va_start (args, fmt);
- vsprintf (error_buf, fmt, args);
- va_end (args);
- if (test_opt (sb, ERRORS_PANIC))
- panic ("EXT2-fs panic (device %s): %s: %s\n",
- sb->s_id, function, error_buf);
- printk (KERN_CRIT "EXT2-fs error (device %s): %s: %s\n",
- sb->s_id, function, error_buf);
- if (test_opt (sb, ERRORS_RO)) {
- printk ("Remounting filesystem read-only\n");
+
+ va_start(args, fmt);
+ printk(KERN_CRIT "EXT2-fs error (device %s): %s: ",sb->s_id, function);
+ vprintk(fmt, args);
+ printk("\n");
+ va_end(args);
+
+ if (test_opt(sb, ERRORS_PANIC))
+ panic("EXT2-fs panic from previous error\n");
+ if (test_opt(sb, ERRORS_RO)) {
+ printk("Remounting filesystem read-only\n");
sb->s_flags |= MS_RDONLY;
}
}
@@ -79,12 +78,13 @@ NORET_TYPE void ext2_panic (struct super
mark_buffer_dirty(sbi->s_sbh);
sb->s_dirt = 1;
}
- va_start (args, fmt);
- vsprintf (error_buf, fmt, args);
- va_end (args);
+ va_start(args, fmt);
+ printk(KERN_CRIT "EXT2-fs error (device %s): %s: ",sb->s_id, function);
+ vprintk(fmt, args);
+ printk("\n");
+ va_end(args);
sb->s_flags |= MS_RDONLY;
- panic ("EXT2-fs panic (device %s): %s: %s\n",
- sb->s_id, function, error_buf);
+ panic("EXT2-fs panic forced\n");
}
void ext2_warning (struct super_block * sb, const char * function,
@@ -92,11 +92,12 @@ void ext2_warning (struct super_block *
{
va_list args;
- va_start (args, fmt);
- vsprintf (error_buf, fmt, args);
- va_end (args);
- printk (KERN_WARNING "EXT2-fs warning (device %s): %s: %s\n",
- sb->s_id, function, error_buf);
+ va_start(args, fmt);
+ printk(KERN_WARNING "EXT2-fs warning (device %s): %s: ",
+ sb->s_id, function);
+ vprintk(fmt, args);
+ printk("\n");
+ va_end(args);
}
void ext2_update_dynamic_rev(struct super_block *sb)
_
-- Mathematics is the supreme nostalgia of our time. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Previous message: Felipe Alfaro Solana: "Re: [patch] voluntary-preempt-2.6.8-rc2-L2 PS2 keyboard gone south"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
- Re: A Bug in gcc or asm/string.h ?
... My apologies to the GCC team, in case anyone has read it. ... Indeed the compiler
has to assume that any memory location has changed. ... static inline int strcmp(const
char * cs,const char * ct) ... send the line "unsubscribe linux-kernel" in ...
(Linux-Kernel) - Re: [OT] Re: 0xdeadbeef vs 0xdeadbeefL
... > Argh, I've mentioned BK. ... _Especially_ when it comes to signedness
... than char can represent. ... send the line "unsubscribe linux-kernel"
in ... (Linux-Kernel) - Re: [PATCH] embarassing typo
... I was gonna ask what language is so complex as to need an 8 ... Would an 8 byte
char be enough ... Copyright 2005 by Maurice Eugene Heskett, ... send the
line "unsubscribe linux-kernel" in ... (Linux-Kernel) - Re: Suspend 2 merge: 49/51: Checksumming
... If your root filesystem is ext2, you have no problem, ... you could probably
mount ext3 as read-only ext2... ... send the line "unsubscribe linux-kernel"
in ... (Linux-Kernel) - Re: Memory pressure handling with iSCSI
... >> dirty levels? ... > to perform initial investigation on ext2.
... > writepageon it and we'll discover the buffers' cleanness and the page ...
send the line "unsubscribe linux-kernel" in ... (Linux-Kernel)