From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
To: "Theodore Ts'o" <tytso@mit.edu>,
Andreas Dilger <adilger.kernel@dilger.ca>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>,
linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] ext4: fix transposition typo in format string
Date: Fri, 20 Feb 2015 15:11:35 +0100 [thread overview]
Message-ID: <1424441495-32581-1-git-send-email-linux@rasmusvillemoes.dk> (raw)
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 <linux@rasmusvillemoes.dk>
---
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,
--
2.1.3
next reply other threads:[~2015-02-20 14:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-20 14:11 Rasmus Villemoes [this message]
2015-03-02 9:55 ` [PATCH] ext4: fix transposition typo in format string Rasmus Villemoes
2015-04-02 20:47 ` Theodore Ts'o
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=1424441495-32581-1-git-send-email-linux@rasmusvillemoes.dk \
--to=linux@rasmusvillemoes.dk \
--cc=adilger.kernel@dilger.ca \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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).