From patchwork Wed May 11 00:23:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 1441 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:52:00 -0000 Delivered-To: patches@linaro.org Received: by 10.224.61.3 with SMTP id r3cs39588qah; Tue, 10 May 2011 17:23:14 -0700 (PDT) Received: by 10.236.178.98 with SMTP id e62mr3884668yhm.319.1305073394606; Tue, 10 May 2011 17:23:14 -0700 (PDT) Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.152]) by mx.google.com with ESMTPS id 47si20017193yhl.98.2011.05.10.17.23.13 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 10 May 2011 17:23:13 -0700 (PDT) Received-SPF: pass (google.com: domain of jstultz@us.ibm.com designates 32.97.110.152 as permitted sender) client-ip=32.97.110.152; Authentication-Results: mx.google.com; spf=pass (google.com: domain of jstultz@us.ibm.com designates 32.97.110.152 as permitted sender) smtp.mail=jstultz@us.ibm.com Received: from d03relay03.boulder.ibm.com (d03relay03.boulder.ibm.com [9.17.195.228]) by e34.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id p4B0Aklx020220; Tue, 10 May 2011 18:10:46 -0600 Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d03relay03.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p4B0NAlq147838; Tue, 10 May 2011 18:23:10 -0600 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p4AIN9YH014644; Tue, 10 May 2011 12:23:10 -0600 Received: from kernel.beaverton.ibm.com (kernel.beaverton.ibm.com [9.47.67.96]) by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p4AIN9q7014637; Tue, 10 May 2011 12:23:09 -0600 Received: by kernel.beaverton.ibm.com (Postfix, from userid 1056) id 110381E7511; Tue, 10 May 2011 17:23:09 -0700 (PDT) From: John Stultz To: LKML Cc: John Stultz , "Ted Ts'o" , KOSAKI Motohiro , David Rientjes , Dave Hansen , Andrew Morton , 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 Message-Id: <1305073386-4810-4-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.7.3.2.146.gca209 In-Reply-To: <1305073386-4810-1-git-send-email-john.stultz@linaro.org> References: <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 CC: KOSAKI Motohiro CC: David Rientjes CC: Dave Hansen CC: Andrew Morton CC: linux-mm@kvack.org Signed-off-by: John Stultz --- 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);