mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hyunchul Lee <cheol.lee@lge.com>
To: Richard Weinberger <richard@nod.at>
Cc: <kernel-team@lge.com>, Artem Bityutskiy <dedekind1@gmail.com>,
	<adrian.hunter@intel.com>, <linux-kernel@vger.kernel.org>,
	<linux-fsdevel@vger.kernel.org>, <linux-mtd@lists.infradead.org>,
	Hyunchul Lee <hyc.lee@gmail.com>,
	Hyunchul Lee <cheol.lee@lge.com>
Subject: [PATCH 2/3] ubifs: fix debug messages for an invalid filename in ubifs_dump_node
Date: Wed, 15 Mar 2017 10:31:04 +0900	[thread overview]
Message-ID: <1489541465-25663-2-git-send-email-cheol.lee@lge.com> (raw)
In-Reply-To: <1489541465-25663-1-git-send-email-cheol.lee@lge.com>

if a character is not printable, print '?' instead of that.

Signed-off-by: Hyunchul Lee <cheol.lee@lge.com>
---
 fs/ubifs/debug.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c
index 1e712a36..b14c06f 100644
--- a/fs/ubifs/debug.c
+++ b/fs/ubifs/debug.c
@@ -32,6 +32,7 @@
 #include <linux/math64.h>
 #include <linux/uaccess.h>
 #include <linux/random.h>
+#include <linux/ctype.h>
 #include "ubifs.h"
 
 static DEFINE_SPINLOCK(dbg_lock);
@@ -464,7 +465,8 @@ void ubifs_dump_node(const struct ubifs_info *c, const void *node)
 			pr_err("(bad name length, not printing, bad or corrupted node)");
 		else {
 			for (i = 0; i < nlen && dent->name[i]; i++)
-				pr_cont("%c", dent->name[i]);
+				pr_cont("%c", isprint(dent->name[i]) ?
+					dent->name[i] : '?');
 		}
 		pr_cont("\n");
 
-- 
1.9.1

  reply	other threads:[~2017-03-15  1:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-15  1:31 [PATCH 1/3] ubifs: remove filename from debug messages in ubifs_readdir Hyunchul Lee
2017-03-15  1:31 ` Hyunchul Lee [this message]
2017-03-15  1:31 ` [PATCH 3/3] ubifs: fix debug messages for an invalid filename in ubifs_dump_inode Hyunchul Lee
2017-03-19 20:39 ` [PATCH 1/3] ubifs: remove filename from debug messages in ubifs_readdir Richard Weinberger

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=1489541465-25663-2-git-send-email-cheol.lee@lge.com \
    --to=cheol.lee@lge.com \
    --cc=adrian.hunter@intel.com \
    --cc=dedekind1@gmail.com \
    --cc=hyc.lee@gmail.com \
    --cc=kernel-team@lge.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard@nod.at \
    /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

all inboxes | Powered by JetHome®