diff mbox

new 3.5.2 ubifs debug assert

Message ID 1345575791.1886.1.camel@kyv
State New, archived
Headers show

Commit Message

Artem Bityutskiy Aug. 21, 2012, 7:03 p.m. UTC
Hi, the below (and attached) patch should fix the issue. Thanks for reporting.
Could you please give it a try?

From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Date: Tue, 21 Aug 2012 21:50:58 +0300
Subject: [PATCH] UBIFS: fix complaints about too small debug buffer size

When debugging is enabled, we use a temporary on-stack buffer for formatting
the key strings like "(11368871, direntry, 0xcd0750)". The buffer size is
32 bytes and sometimes it is not enough to fit the key string - e.g., when
inode numbers are high. This is not fatal, but the key strings are incomplete
and UBIFS complains like this:

	UBIFS assert failed in dbg_snprintf_key at 137 (pid 1)

This is a regression caused by "515315a UBIFS: fix key printing".

Fix the issue by increasing the buffer to 48 bytes.

Reported-by: Michael Hench <michaelhench@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Cc: stable@vger.kernel.org [v3.3+]
---
 fs/ubifs/debug.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Hench Aug. 21, 2012, 7:44 p.m. UTC | #1
On Tue, Aug 21, 2012 at 2:03 PM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
> Hi, the below (and attached) patch should fix the issue. Thanks for reporting.
> Could you please give it a try?
>

seems to work...


Thank You.
Mike Hench
Artem Bityutskiy Aug. 22, 2012, 8:51 a.m. UTC | #2
On Tue, 2012-08-21 at 14:44 -0500, Michael Hench wrote:
> On Tue, Aug 21, 2012 at 2:03 PM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
> > Hi, the below (and attached) patch should fix the issue. Thanks for reporting.
> > Could you please give it a try?
> >
> 
> seems to work...

OK, I'll add

	Tested-by: Mike Hench <MichaelHench@gmail.com>

and send the fix to Linus. Thanks!
diff mbox

Patch

From 5cd6a143c612899a593764f106a61eee5a6277c0 Mon Sep 17 00:00:00 2001
From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Date: Tue, 21 Aug 2012 21:50:58 +0300
Subject: [PATCH] UBIFS: fix complaints about too small debug buffer size

When debugging is enabled, we use a temporary on-stack buffer for formatting
the key strings like "(11368871, direntry, 0xcd0750)". The buffer size is
32 bytes and sometimes it is not enough to fit the key string - e.g., when
inode numbers are high. This is not fatal, but the key strings are incomplete
and UBIFS complains like this:

	UBIFS assert failed in dbg_snprintf_key at 137 (pid 1)

This is a regression caused by "515315a UBIFS: fix key printing".

Fix the issue by increasing the buffer to 48 bytes.

Reported-by: Michael Hench <michaelhench@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Cc: stable@vger.kernel.org [v3.3+]
---
 fs/ubifs/debug.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ubifs/debug.h b/fs/ubifs/debug.h
index 8b8cc4e..760de72 100644
--- a/fs/ubifs/debug.h
+++ b/fs/ubifs/debug.h
@@ -167,7 +167,7 @@  struct ubifs_global_debug_info {
 #define ubifs_dbg_msg(type, fmt, ...) \
 	pr_debug("UBIFS DBG " type ": " fmt "\n", ##__VA_ARGS__)
 
-#define DBG_KEY_BUF_LEN 32
+#define DBG_KEY_BUF_LEN 48
 #define ubifs_dbg_msg_key(type, key, fmt, ...) do {                            \
 	char __tmp_key_buf[DBG_KEY_BUF_LEN];                                   \
 	pr_debug("UBIFS DBG " type ": " fmt "%s\n", ##__VA_ARGS__,             \
-- 
1.7.11.2