linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Stultz <john.stultz@linaro.org>
To: LKML <linux-kernel@vger.kernel.org>
Cc: John Stultz <john.stultz@linaro.org>, "Ted Ts'o" <tytso@mit.edu>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	David Rientjes <rientjes@google.com>,
	Dave Hansen <dave@linux.vnet.ibm.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org
Subject: [PATCH 3/3] comm: ext4: Protect task->comm access by using %ptc
Date: Tue, 10 May 2011 17:23:06 -0700	[thread overview]
Message-ID: <1305073386-4810-4-git-send-email-john.stultz@linaro.org> (raw)
In-Reply-To: <1305073386-4810-1-git-send-email-john.stultz@linaro.org>

Converts ext4 comm access to use the safe printk %ptc accessor.

CC: Ted Ts'o <tytso@mit.edu>
CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
CC: David Rientjes <rientjes@google.com>
CC: Dave Hansen <dave@linux.vnet.ibm.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: linux-mm@kvack.org
Signed-off-by: John Stultz <john.stultz@linaro.org>
---
 fs/ext4/file.c  |    4 ++--
 fs/ext4/super.c |    8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/fs/ext4/file.c b/fs/ext4/file.c
index 7b80d54..31438a0 100644
--- a/fs/ext4/file.c
+++ b/fs/ext4/file.c
@@ -126,9 +126,9 @@ ext4_file_write(struct kiocb *iocb, const struct iovec *iov,
 		/* Warn about this once per day */
 		if (printk_timed_ratelimit(&unaligned_warn_time, 60*60*24*HZ))
 			ext4_msg(inode->i_sb, KERN_WARNING,
-				 "Unaligned AIO/DIO on inode %ld by %s; "
+				 "Unaligned AIO/DIO on inode %ld by %ptc; "
 				 "performance will be poor.",
-				 inode->i_ino, current->comm);
+				 inode->i_ino, current);
 		mutex_lock(ext4_aio_mutex(inode));
 		ext4_aiodio_wait(inode);
 	}
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 8553dfb..d4ab4c0 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -413,8 +413,8 @@ void __ext4_error(struct super_block *sb, const char *function,
 	va_start(args, fmt);
 	vaf.fmt = fmt;
 	vaf.va = &args;
-	printk(KERN_CRIT "EXT4-fs error (device %s): %s:%d: comm %s: %pV\n",
-	       sb->s_id, function, line, current->comm, &vaf);
+	printk(KERN_CRIT "EXT4-fs error (device %s): %s:%d: comm %ptc: %pV\n",
+	       sb->s_id, function, line, current, &vaf);
 	va_end(args);
 
 	ext4_handle_error(sb);
@@ -438,7 +438,7 @@ void ext4_error_inode(struct inode *inode, const char *function,
 	       inode->i_sb->s_id, function, line, inode->i_ino);
 	if (block)
 		printk(KERN_CONT "block %llu: ", block);
-	printk(KERN_CONT "comm %s: %pV\n", current->comm, &vaf);
+	printk(KERN_CONT "comm %ptc: %pV\n", current, &vaf);
 	va_end(args);
 
 	ext4_handle_error(inode->i_sb);
@@ -468,7 +468,7 @@ void ext4_error_file(struct file *file, const char *function,
 	va_start(args, fmt);
 	vaf.fmt = fmt;
 	vaf.va = &args;
-	printk(KERN_CONT "comm %s: path %s: %pV\n", current->comm, path, &vaf);
+	printk(KERN_CONT "comm %ptc: path %s: %pV\n", current, path, &vaf);
 	va_end(args);
 
 	ext4_handle_error(inode->i_sb);
-- 
1.7.3.2.146.gca209


  parent reply	other threads:[~2011-05-11  0:23 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-11  0:23 [RFC][PATCH 0/3] v2 Improve task->comm locking situation John Stultz
2011-05-11  0:23 ` [PATCH 1/3] comm: Introduce comm_lock seqlock to protect task->comm access John Stultz
2011-05-11 17:39   ` Andi Kleen
2011-05-12 22:00   ` David Rientjes
2011-05-11  0:23 ` [PATCH 2/3] printk: Add %ptc to safely print a task's comm John Stultz
2011-05-11  0:51   ` Joe Perches
2011-05-11  1:10     ` John Stultz
2011-05-11  1:16       ` john stultz
2011-05-11  1:20       ` Joe Perches
2011-05-12 22:12         ` David Rientjes
2011-05-12 22:29           ` Joe Perches
2011-05-13 21:56             ` David Rientjes
2011-05-12 22:10       ` David Rientjes
2011-05-11  9:33   ` Américo Wang
2011-05-11 21:02     ` John Stultz
2011-05-12 10:43       ` Américo Wang
2011-05-12 10:45         ` Américo Wang
2011-05-12 18:01         ` John Stultz
2011-05-11 17:36   ` Andi Kleen
2011-05-11 21:04     ` John Stultz
2011-05-11  0:23 ` John Stultz [this message]
2011-05-12 22:14   ` [PATCH 3/3] comm: ext4: Protect task->comm access by using %ptc David Rientjes
2011-05-12 22:29     ` John Stultz
2011-05-12 22:34       ` Andrew Morton

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=1305073386-4810-4-git-send-email-john.stultz@linaro.org \
    --to=john.stultz@linaro.org \
    --cc=akpm@linux-foundation.org \
    --cc=dave@linux.vnet.ibm.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rientjes@google.com \
    --cc=tytso@mit.edu \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).