From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753783AbbCBJzs (ORCPT ); Mon, 2 Mar 2015 04:55:48 -0500 Received: from mail-lb0-f180.google.com ([209.85.217.180]:35119 "EHLO mail-lb0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751340AbbCBJzo (ORCPT ); Mon, 2 Mar 2015 04:55:44 -0500 From: Rasmus Villemoes To: "Theodore Ts'o" Cc: Andreas Dilger , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ext4: fix transposition typo in format string Organization: D03 References: <1424441495-32581-1-git-send-email-linux@rasmusvillemoes.dk> X-Hashcash: 1:20:150302:linux-ext4@vger.kernel.org::VRv+uWjMENbfgRfu:0000000000000000000000000000000000003B5 X-Hashcash: 1:20:150302:linux-kernel@vger.kernel.org::1E2MZOPcdvG4VplB:0000000000000000000000000000000000y8p X-Hashcash: 1:20:150302:tytso@mit.edu::ZXFjt/b/i5M49m8T:00001hg3 X-Hashcash: 1:20:150302:adilger.kernel@dilger.ca::CTcThhdEj3FtTLTC:00000000000000000000000000000000000009aZ+ Date: Mon, 02 Mar 2015 10:55:41 +0100 In-Reply-To: <1424441495-32581-1-git-send-email-linux@rasmusvillemoes.dk> (Rasmus Villemoes's message of "Fri, 20 Feb 2015 15:11:35 +0100") Message-ID: <878uffhgf6.fsf@rasmusvillemoes.dk> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ping... (maybe I should have used a more dramatic subject - I do think this is a real bug, but if not, I'd still like to get an explicit NAK.) On Fri, Feb 20 2015, Rasmus Villemoes wrote: > According to C99, %*.s means the same as %*.0s, in other words, print > as many spaces as the field width argument says and effectively ignore > the string argument. That is certainly not what was meant here. The > kernel's printf implementation, however, treats it as if the . was not > there, i.e. as %*s. I don't know if de->name is nul-terminated or not, > but in any case I'm guessing the intention was to use de->name_len as > precision instead of field width. > > Signed-off-by: Rasmus Villemoes > --- > If de->name is not guaranteed to be nul-terminated, I suppose this is > even -stable material. > > fs/ext4/inline.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c > index 4b143febf21f..8b64d715e476 100644 > --- a/fs/ext4/inline.c > +++ b/fs/ext4/inline.c > @@ -972,7 +972,7 @@ void ext4_show_inline_dir(struct inode *dir, struct buffer_head *bh, > offset = 0; > while ((void *)de < dlimit) { > de_len = ext4_rec_len_from_disk(de->rec_len, inline_size); > - trace_printk("de: off %u rlen %u name %*.s nlen %u ino %u\n", > + trace_printk("de: off %u rlen %u name %.*s nlen %u ino %u\n", > offset, de_len, de->name_len, de->name, > de->name_len, le32_to_cpu(de->inode)); > if (ext4_check_dir_entry(dir, NULL, de, bh,