Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1600983 > unrolled thread

[PATCH 1/3] ubifs: remove filename from debug messages in ubifs_readdir

Started byHyunchul Lee <cheol.lee@lge.com>
First post2017-03-15 02:40 +0100
Last post2017-03-19 21:50 +0100
Articles 4 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/3] ubifs: remove filename from debug messages in ubifs_readdir Hyunchul Lee <cheol.lee@lge.com> - 2017-03-15 02:40 +0100
    [PATCH 2/3] ubifs: fix debug messages for an invalid filename in ubifs_dump_node Hyunchul Lee <cheol.lee@lge.com> - 2017-03-15 02:40 +0100
    [PATCH 3/3] ubifs: fix debug messages for an invalid filename in ubifs_dump_inode Hyunchul Lee <cheol.lee@lge.com> - 2017-03-15 02:40 +0100
    Re: [PATCH 1/3] ubifs: remove filename from debug messages in  ubifs_readdir Richard Weinberger <richard@nod.at> - 2017-03-19 21:50 +0100

#1600983 — [PATCH 1/3] ubifs: remove filename from debug messages in ubifs_readdir

FromHyunchul Lee <cheol.lee@lge.com>
Date2017-03-15 02:40 +0100
Subject[PATCH 1/3] ubifs: remove filename from debug messages in ubifs_readdir
Message-ID<tl64V-je-1@gated-at.bofh.it>
if filename is encrypted, filename could have no printable characters.
so remove it.

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

diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
index 528369f..b2c8beb 100644
--- a/fs/ubifs/dir.c
+++ b/fs/ubifs/dir.c
@@ -606,8 +606,8 @@ static int ubifs_readdir(struct file *file, struct dir_context *ctx)
 	}
 
 	while (1) {
-		dbg_gen("feed '%s', ino %llu, new f_pos %#x",
-			dent->name, (unsigned long long)le64_to_cpu(dent->inum),
+		dbg_gen("ino %llu, new f_pos %#x",
+			(unsigned long long)le64_to_cpu(dent->inum),
 			key_hash_flash(c, &dent->key));
 		ubifs_assert(le64_to_cpu(dent->ch.sqnum) >
 			     ubifs_inode(dir)->creat_sqnum);
-- 
1.9.1

[toc] | [next] | [standalone]


#1600984 — [PATCH 2/3] ubifs: fix debug messages for an invalid filename in ubifs_dump_node

FromHyunchul Lee <cheol.lee@lge.com>
Date2017-03-15 02:40 +0100
Subject[PATCH 2/3] ubifs: fix debug messages for an invalid filename in ubifs_dump_node
Message-ID<tl64V-je-3@gated-at.bofh.it>
In reply to#1600983
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

[toc] | [prev] | [next] | [standalone]


#1600985 — [PATCH 3/3] ubifs: fix debug messages for an invalid filename in ubifs_dump_inode

FromHyunchul Lee <cheol.lee@lge.com>
Date2017-03-15 02:40 +0100
Subject[PATCH 3/3] ubifs: fix debug messages for an invalid filename in ubifs_dump_inode
Message-ID<tl64V-je-5@gated-at.bofh.it>
In reply to#1600983
instead of filenames, print inode numbers, file types, and length.

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

diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c
index b14c06f..718b749 100644
--- a/fs/ubifs/debug.c
+++ b/fs/ubifs/debug.c
@@ -287,8 +287,10 @@ void ubifs_dump_inode(struct ubifs_info *c, const struct inode *inode)
 			break;
 		}
 
-		pr_err("\t%d: %s (%s)\n",
-		       count++, dent->name, get_dent_type(dent->type));
+		pr_err("\t%d: inode %llu, type %s, len %d\n",
+		       count++, (unsigned long long) le64_to_cpu(dent->inum),
+		       get_dent_type(dent->type),
+		       le16_to_cpu(dent->nlen));
 
 		fname_name(&nm) = dent->name;
 		fname_len(&nm) = le16_to_cpu(dent->nlen);
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1604084 — Re: [PATCH 1/3] ubifs: remove filename from debug messages in ubifs_readdir

FromRichard Weinberger <richard@nod.at>
Date2017-03-19 21:50 +0100
SubjectRe: [PATCH 1/3] ubifs: remove filename from debug messages in ubifs_readdir
Message-ID<tmPW1-2E6-1@gated-at.bofh.it>
In reply to#1600983
Hyunchul,

Am 15.03.2017 um 02:31 schrieb Hyunchul Lee:
> if filename is encrypted, filename could have no printable characters.
> so remove it.

thanks for cleaning this up!
All three patches look good to me.

Thanks,
//richard

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web