lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 15 Mar 2012 17:07:33 -0700
From:	Joe Perches <joe@...ches.com>
To:	"Theodore Ts'o" <tytso@....edu>,
	Andreas Dilger <adilger.kernel@...ger.ca>
Cc:	linux-ext4@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 5/9] ext4: Avoid output message interleaving in ext4_error_<foo>

Using pr_cont means that messages from multiple threads
may be interleaved.  Avoid this by using a single pr_<level>
call in ext4_error_inode and ext4_error_file.

Signed-off-by: Joe Perches <joe@...ches.com>
---
 fs/ext4/super.c |   24 +++++++++++++++---------
 1 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 4e1d656..ac77a95 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -517,11 +517,14 @@ void ext4_error_inode(struct inode *inode, const char *function,
 	va_start(args, fmt);
 	vaf.fmt = fmt;
 	vaf.va = &args;
-	pr_crit("error (device %s): %s:%d: inode #%lu: ",
-		inode->i_sb->s_id, function, line, inode->i_ino);
 	if (block)
-		pr_cont("block %llu: ", block);
-	pr_cont("comm %s: %pV\n", current->comm, &vaf);
+		pr_crit("error (device %s): %s:%d: inode #%lu: block %llu: comm %s: %pV\n",
+			inode->i_sb->s_id, function, line, inode->i_ino,
+			block, current->comm, &vaf);
+	else
+		pr_crit("error (device %s): %s:%d: inode #%lu: comm %s: %pV\n",
+			inode->i_sb->s_id, function, line, inode->i_ino,
+			current->comm, &vaf);
 	va_end(args);
 
 	ext4_handle_error(inode->i_sb);
@@ -543,14 +546,17 @@ void ext4_error_file(struct file *file, const char *function,
 	path = d_path(&(file->f_path), pathname, sizeof(pathname));
 	if (IS_ERR(path))
 		path = "(unknown)";
-	pr_crit("error (device %s): %s:%d: inode #%lu: ",
-		inode->i_sb->s_id, function, line, inode->i_ino);
-	if (block)
-		pr_cont("block %llu: ", block);
 	va_start(args, fmt);
 	vaf.fmt = fmt;
 	vaf.va = &args;
-	pr_cont("comm %s: path %s: %pV\n", current->comm, path, &vaf);
+	if (block)
+		pr_crit("error (device %s): %s:%d: inode #%lu: block %llu: comm %s: path %s: %pV\n",
+			inode->i_sb->s_id, function, line, inode->i_ino,
+			block, current->comm, path, &vaf);
+	else
+		pr_crit("error (device %s): %s:%d: inode #%lu: comm %s: path %s: %pV\n",
+			inode->i_sb->s_id, function, line, inode->i_ino,
+			current->comm, path, &vaf);
 	va_end(args);
 
 	ext4_handle_error(inode->i_sb);
-- 
1.7.8.111.gad25c.dirty

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ