Patchwork fs: ext4: Printing debug is now configurable

login
register
mail settings
Submitter Paul Taysom
Date April 30, 2013, 9:51 p.m.
Message ID <1367358660-940-1-git-send-email-taysom@chromium.org>
Download mbox | patch
Permalink /patch/240699/
State Accepted
Headers show

Comments

Paul Taysom - April 30, 2013, 9:51 p.m.
Printing the "truncating inode" and "deleting unreferenced inode"
messages is now controlled by the "debug" option to mount.
These messages were filling the /var/log/messages file and
are normal for ext4 file system recovery.

Tested by opening several files, unlinking them, then
crashing the system, rebooting the system and examining
/var/log/messages.

Addresses the problem described in http://crbug.com/220976

Signed-off-by: Paul Taysom <taysom@chromium.org>
---
 fs/ext4/super.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
Paul Taysom - May 22, 2013, 11:44 p.m.
Ted,
Do you have a status for this patch?
Thanks,
Paul
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Theodore Ts'o - May 28, 2013, 11:53 a.m.
On Tue, Apr 30, 2013 at 02:51:00PM -0700, Paul Taysom wrote:
> Printing the "truncating inode" and "deleting unreferenced inode"
> messages is now controlled by the "debug" option to mount.
> These messages were filling the /var/log/messages file and
> are normal for ext4 file system recovery.
> 
> Tested by opening several files, unlinking them, then
> crashing the system, rebooting the system and examining
> /var/log/messages.
> 
> Addresses the problem described in http://crbug.com/220976
> 
> Signed-off-by: Paul Taysom <taysom@chromium.org>

Added to the ext4 patch queue with a slightly modified description.
(Sorry for the delay, you sent the patch just as the merge window had
starting, and I wasn't accepting new until the tree had settled down.)

	      	       		     - Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 5d6d5357..ed246fc 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -2163,9 +2163,10 @@  static void ext4_orphan_cleanup(struct super_block *sb,
 		list_add(&EXT4_I(inode)->i_orphan, &EXT4_SB(sb)->s_orphan);
 		dquot_initialize(inode);
 		if (inode->i_nlink) {
-			ext4_msg(sb, KERN_DEBUG,
-				"%s: truncating inode %lu to %lld bytes",
-				__func__, inode->i_ino, inode->i_size);
+			if (test_opt(sb, DEBUG))
+				ext4_msg(sb, KERN_DEBUG,
+					"%s: truncating inode %lu to %lld bytes",
+					__func__, inode->i_ino, inode->i_size);
 			jbd_debug(2, "truncating inode %lu to %lld bytes\n",
 				  inode->i_ino, inode->i_size);
 			mutex_lock(&inode->i_mutex);
@@ -2173,9 +2174,10 @@  static void ext4_orphan_cleanup(struct super_block *sb,
 			mutex_unlock(&inode->i_mutex);
 			nr_truncates++;
 		} else {
-			ext4_msg(sb, KERN_DEBUG,
-				"%s: deleting unreferenced inode %lu",
-				__func__, inode->i_ino);
+			if (test_opt(sb, DEBUG))
+				ext4_msg(sb, KERN_DEBUG,
+					"%s: deleting unreferenced inode %lu",
+					__func__, inode->i_ino);
 			jbd_debug(2, "deleting unreferenced inode %lu\n",
 				  inode->i_ino);
 			nr_orphans++;