All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kasper Sandberg <lkml@metanurb.dk>
To: LKML Mailinglist <linux-kernel@vger.kernel.org>
Subject: [PATCH] Make some ext3 kernel messages useful by showing device
Date: Sun, 08 Jun 2008 21:02:41 +0200	[thread overview]
Message-ID: <1212951761.32756.4.camel@localhost> (raw)

[-- Attachment #1: Type: text/plain, Size: 2696 bytes --]

Hello.

Some of the ext3 warnings in super.c are not really as useful as they
can be, for instance the "EXT3-fs warning: maximal mount count reached,
running e2fsck is recommended" message, does not tell which device it
actually is.

Below is patch(both inlined, and in attached form, since i dont trust my
mailer), to a patch which fixes that particular message, and a few more.
I could look at the rest if anyones interrested?

Oh, and i dont really know if this is nessecary, but:
Signed-off-by: Kasper Sandberg <lkml@metanurb.dk>


--- super.c.orig	2008-06-08 20:49:26.153047364 +0200
+++ super.c	2008-06-08 20:45:20.812047463 +0200
@@ -1188,31 +1188,31 @@
 	int res = 0;
 
 	if (le32_to_cpu(es->s_rev_level) > EXT3_MAX_SUPP_REV) {
-		printk (KERN_ERR "EXT3-fs warning: revision level too high, "
-			"forcing read-only mode\n");
+		printk (KERN_ERR "EXT3-fs on %s warning: revision level too high, "
+			"forcing read-only mode\n", sb->s_id);
 		res = MS_RDONLY;
 	}
 	if (read_only)
 		return res;
 	if (!(sbi->s_mount_state & EXT3_VALID_FS))
-		printk (KERN_WARNING "EXT3-fs warning: mounting unchecked fs, "
-			"running e2fsck is recommended\n");
+		printk (KERN_WARNING "EXT3-fs on %s warning: mounting unchecked fs, "
+			"running e2fsck is recommended\n", sb->s_id);
 	else if ((sbi->s_mount_state & EXT3_ERROR_FS))
 		printk (KERN_WARNING
-			"EXT3-fs warning: mounting fs with errors, "
-			"running e2fsck is recommended\n");
+			"EXT3-fs on %s warning: mounting fs with errors, "
+			"running e2fsck is recommended\n", sb->s_id);
 	else if ((__s16) le16_to_cpu(es->s_max_mnt_count) >= 0 &&
 		 le16_to_cpu(es->s_mnt_count) >=
 		 (unsigned short) (__s16) le16_to_cpu(es->s_max_mnt_count))
 		printk (KERN_WARNING
-			"EXT3-fs warning: maximal mount count reached, "
-			"running e2fsck is recommended\n");
+			"EXT3-fs on %s warning: maximal mount count reached, "
+			"running e2fsck is recommended\n", sb->s_id);
 	else if (le32_to_cpu(es->s_checkinterval) &&
 		(le32_to_cpu(es->s_lastcheck) +
 			le32_to_cpu(es->s_checkinterval) <= get_seconds()))
 		printk (KERN_WARNING
-			"EXT3-fs warning: checktime reached, "
-			"running e2fsck is recommended\n");
+			"EXT3-fs on %s warning: checktime reached, "
+			"running e2fsck is recommended\n", sb->s_id);
 #if 0
 		/* @@@ We _will_ want to clear the valid bit if we find
                    inconsistencies, to force a fsck at reboot.  But for
@@ -1339,8 +1339,8 @@
 	}
 
 	if (bdev_read_only(sb->s_bdev)) {
-		printk(KERN_ERR "EXT3-fs: write access "
-			"unavailable, skipping orphan cleanup.\n");
+		printk(KERN_ERR "EXT3-fs on %s: write access "
+			"unavailable, skipping orphan cleanup.\n", sb->s_id);
 		return;
 	}
 


[-- Attachment #2: super.c.diff --]
[-- Type: text/x-patch, Size: 2159 bytes --]

--- super.c.orig	2008-06-08 20:49:26.153047364 +0200
+++ super.c	2008-06-08 20:45:20.812047463 +0200
@@ -1188,31 +1188,31 @@
 	int res = 0;
 
 	if (le32_to_cpu(es->s_rev_level) > EXT3_MAX_SUPP_REV) {
-		printk (KERN_ERR "EXT3-fs warning: revision level too high, "
-			"forcing read-only mode\n");
+		printk (KERN_ERR "EXT3-fs on %s warning: revision level too high, "
+			"forcing read-only mode\n", sb->s_id);
 		res = MS_RDONLY;
 	}
 	if (read_only)
 		return res;
 	if (!(sbi->s_mount_state & EXT3_VALID_FS))
-		printk (KERN_WARNING "EXT3-fs warning: mounting unchecked fs, "
-			"running e2fsck is recommended\n");
+		printk (KERN_WARNING "EXT3-fs on %s warning: mounting unchecked fs, "
+			"running e2fsck is recommended\n", sb->s_id);
 	else if ((sbi->s_mount_state & EXT3_ERROR_FS))
 		printk (KERN_WARNING
-			"EXT3-fs warning: mounting fs with errors, "
-			"running e2fsck is recommended\n");
+			"EXT3-fs on %s warning: mounting fs with errors, "
+			"running e2fsck is recommended\n", sb->s_id);
 	else if ((__s16) le16_to_cpu(es->s_max_mnt_count) >= 0 &&
 		 le16_to_cpu(es->s_mnt_count) >=
 		 (unsigned short) (__s16) le16_to_cpu(es->s_max_mnt_count))
 		printk (KERN_WARNING
-			"EXT3-fs warning: maximal mount count reached, "
-			"running e2fsck is recommended\n");
+			"EXT3-fs on %s warning: maximal mount count reached, "
+			"running e2fsck is recommended\n", sb->s_id);
 	else if (le32_to_cpu(es->s_checkinterval) &&
 		(le32_to_cpu(es->s_lastcheck) +
 			le32_to_cpu(es->s_checkinterval) <= get_seconds()))
 		printk (KERN_WARNING
-			"EXT3-fs warning: checktime reached, "
-			"running e2fsck is recommended\n");
+			"EXT3-fs on %s warning: checktime reached, "
+			"running e2fsck is recommended\n", sb->s_id);
 #if 0
 		/* @@@ We _will_ want to clear the valid bit if we find
                    inconsistencies, to force a fsck at reboot.  But for
@@ -1339,8 +1339,8 @@
 	}
 
 	if (bdev_read_only(sb->s_bdev)) {
-		printk(KERN_ERR "EXT3-fs: write access "
-			"unavailable, skipping orphan cleanup.\n");
+		printk(KERN_ERR "EXT3-fs on %s: write access "
+			"unavailable, skipping orphan cleanup.\n", sb->s_id);
 		return;
 	}
 

             reply	other threads:[~2008-06-08 19:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-08 19:02 Kasper Sandberg [this message]
2008-06-09  9:59 ` [PATCH] Make some ext3 kernel messages useful by showing device Andrew Morton
2008-06-09 13:38   ` Kasper Sandberg
2008-06-09 20:48     ` Andrew Morton
2008-06-09 13:43   ` Eric Sandeen
2008-06-09 20:49     ` Andrew Morton
2008-06-09 22:08       ` Andreas Dilger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1212951761.32756.4.camel@localhost \
    --to=lkml@metanurb.dk \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.