提交 e328379a 编写于 作者: H Hyunchul Lee 提交者: Richard Weinberger

ubifs: Fix debug messages for an invalid filename in ubifs_dump_node

if a character is not printable, print '?' instead of that.
Signed-off-by: NHyunchul Lee <cheol.lee@lge.com>
Signed-off-by: NRichard Weinberger <richard@nod.at>
上级 b20e2d99
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <linux/math64.h> #include <linux/math64.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include <linux/random.h> #include <linux/random.h>
#include <linux/ctype.h>
#include "ubifs.h" #include "ubifs.h"
static DEFINE_SPINLOCK(dbg_lock); static DEFINE_SPINLOCK(dbg_lock);
...@@ -464,7 +465,8 @@ void ubifs_dump_node(const struct ubifs_info *c, const void *node) ...@@ -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)"); pr_err("(bad name length, not printing, bad or corrupted node)");
else { else {
for (i = 0; i < nlen && dent->name[i]; i++) 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"); pr_cont("\n");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册