linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] ubifs: remove filename from debug messages in ubifs_readdir
@ 2017-03-15  1:31 Hyunchul Lee
  2017-03-15  1:31 ` [PATCH 2/3] ubifs: fix debug messages for an invalid filename in ubifs_dump_node Hyunchul Lee
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Hyunchul Lee @ 2017-03-15  1:31 UTC (permalink / raw)
  To: Richard Weinberger
  Cc: kernel-team, Artem Bityutskiy, adrian.hunter, linux-kernel,
	linux-fsdevel, linux-mtd, Hyunchul Lee, Hyunchul Lee

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] ubifs: fix debug messages for an invalid filename in ubifs_dump_node
  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
  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
  2 siblings, 0 replies; 4+ messages in thread
From: Hyunchul Lee @ 2017-03-15  1:31 UTC (permalink / raw)
  To: Richard Weinberger
  Cc: kernel-team, Artem Bityutskiy, adrian.hunter, linux-kernel,
	linux-fsdevel, linux-mtd, Hyunchul Lee, Hyunchul Lee

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] ubifs: fix debug messages for an invalid filename in ubifs_dump_inode
  2017-03-15  1:31 [PATCH 1/3] ubifs: remove filename from debug messages in ubifs_readdir Hyunchul Lee
  2017-03-15  1:31 ` [PATCH 2/3] ubifs: fix debug messages for an invalid filename in ubifs_dump_node Hyunchul Lee
@ 2017-03-15  1:31 ` Hyunchul Lee
  2017-03-19 20:39 ` [PATCH 1/3] ubifs: remove filename from debug messages in ubifs_readdir Richard Weinberger
  2 siblings, 0 replies; 4+ messages in thread
From: Hyunchul Lee @ 2017-03-15  1:31 UTC (permalink / raw)
  To: Richard Weinberger
  Cc: kernel-team, Artem Bityutskiy, adrian.hunter, linux-kernel,
	linux-fsdevel, linux-mtd, Hyunchul Lee, Hyunchul Lee

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/3] ubifs: remove filename from debug messages in ubifs_readdir
  2017-03-15  1:31 [PATCH 1/3] ubifs: remove filename from debug messages in ubifs_readdir Hyunchul Lee
  2017-03-15  1:31 ` [PATCH 2/3] ubifs: fix debug messages for an invalid filename in ubifs_dump_node Hyunchul Lee
  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 ` Richard Weinberger
  2 siblings, 0 replies; 4+ messages in thread
From: Richard Weinberger @ 2017-03-19 20:39 UTC (permalink / raw)
  To: Hyunchul Lee
  Cc: kernel-team, Artem Bityutskiy, adrian.hunter, linux-kernel,
	linux-fsdevel, linux-mtd, Hyunchul Lee, David Gstir

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-03-19 20:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-15  1:31 [PATCH 1/3] ubifs: remove filename from debug messages in ubifs_readdir Hyunchul Lee
2017-03-15  1:31 ` [PATCH 2/3] ubifs: fix debug messages for an invalid filename in ubifs_dump_node Hyunchul Lee
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

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).