From patchwork Wed Mar 15 01:31:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hyeoncheol Lee X-Patchwork-Id: 9624679 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CA171604CC for ; Wed, 15 Mar 2017 01:32:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD8E326D05 for ; Wed, 15 Mar 2017 01:32:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B255026E78; Wed, 15 Mar 2017 01:32:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 40B642780C for ; Wed, 15 Mar 2017 01:32:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751088AbdCOBbs (ORCPT ); Tue, 14 Mar 2017 21:31:48 -0400 Received: from LGEAMRELO13.lge.com ([156.147.23.53]:37737 "EHLO lgeamrelo13.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750926AbdCOBbq (ORCPT ); Tue, 14 Mar 2017 21:31:46 -0400 Received: from unknown (HELO lgeamrelo02.lge.com) (156.147.1.126) by 156.147.23.53 with ESMTP; 15 Mar 2017 10:31:43 +0900 X-Original-SENDERIP: 156.147.1.126 X-Original-MAILFROM: cheol.lee@lge.com Received: from unknown (HELO LGEAEXHB03P.LGE.NET) (165.244.249.23) by 156.147.1.126 with ESMTP; 15 Mar 2017 10:31:42 +0900 X-Original-SENDERIP: 165.244.249.23 X-Original-MAILFROM: cheol.lee@lge.com Received: from lgekrmhub06.lge.com (10.185.110.16) by LGEAEXHB03P.LGE.NET (165.244.249.23) with Microsoft SMTP Server id 8.3.264.0; Wed, 15 Mar 2017 10:31:14 +0900 Received: from lgemrelse6q.lge.com ([156.147.1.121]) by lgekrmhub06.lge.com (Lotus Domino Release 8.5.3FP6) with ESMTP id 2017031510311490-141720 ; Wed, 15 Mar 2017 10:31:14 +0900 Received: from unknown (HELO localhost.localdomain) (10.177.225.40) by 156.147.1.121 with ESMTP; 15 Mar 2017 10:31:14 +0900 X-Original-SENDERIP: 10.177.225.40 X-Original-MAILFROM: cheol.lee@lge.com From: Hyunchul Lee To: Richard Weinberger CC: , Artem Bityutskiy , , , , , Hyunchul Lee , Hyunchul Lee 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 Message-ID: <1489541465-25663-2-git-send-email-cheol.lee@lge.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1489541465-25663-1-git-send-email-cheol.lee@lge.com> References: <1489541465-25663-1-git-send-email-cheol.lee@lge.com> X-MIMETrack: Itemize by SMTP Server on LGEKRMHUB06/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2017/03/15 10:31:14, Serialize by Router on LGEKRMHUB06/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2017/03/15 10:31:15, Serialize complete at 2017/03/15 10:31:15 MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP if a character is not printable, print '?' instead of that. Signed-off-by: Hyunchul Lee --- 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 #include #include +#include #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");