* Re: new 3.5.2 ubifs debug assert
2012-08-20 18:09 new 3.5.2 ubifs debug assert Michael Hench
2012-08-20 19:15 ` Artem Bityutskiy
@ 2012-08-21 12:25 ` Artem Bityutskiy
2012-08-21 19:03 ` Artem Bityutskiy
2 siblings, 0 replies; 6+ messages in thread
From: Artem Bityutskiy @ 2012-08-21 12:25 UTC (permalink / raw)
To: MichaelHench; +Cc: linux-mtd
[-- Attachment #1: Type: text/plain, Size: 1215 bytes --]
On Mon, 2012-08-20 at 13:09 -0500, Michael Hench wrote:
> apparently UBIFS debugging is always on in 3.5.2
> can anyone tell me what this means ?
It should not. We use 'pr_debug()' for debugging messages, which are
off by default. To enable them, you need to do something like described
here:
http://www.linux-mtd.infradead.org/faq/ubifs.html#L_how_debug
E.g.,
echo 'format "UBIFS DBG" +pf' > /sys/kernel/debug/dynamic_debug/control
would enable all UBIFS debugging messages.
I do not know why they are switched on in your system.
> UBIFS assert failed in dbg_snprintf_key at 136 (pid 28692)
Hmm, strange, would be interesting to see the length in your setup.
Would you try this patch:
diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c
index bb31672..52b0290 100644
--- a/fs/ubifs/debug.c
+++ b/fs/ubifs/debug.c
@@ -133,6 +133,7 @@ const char *dbg_snprintf_key(const struct ubifs_info *c,
}
} else
len -= snprintf(p, len, "bad key format %d", c->key_fmt);
+ printk(KERN_ERR "len %d, p %s\n", len, p);
ubifs_assert(len > 0);
return p;
}
and send what that printk says?
--
Best Regards,
Artem Bityutskiy
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: new 3.5.2 ubifs debug assert
2012-08-20 18:09 new 3.5.2 ubifs debug assert Michael Hench
2012-08-20 19:15 ` Artem Bityutskiy
2012-08-21 12:25 ` Artem Bityutskiy
@ 2012-08-21 19:03 ` Artem Bityutskiy
2012-08-21 19:44 ` Michael Hench
2 siblings, 1 reply; 6+ messages in thread
From: Artem Bityutskiy @ 2012-08-21 19:03 UTC (permalink / raw)
To: MichaelHench; +Cc: linux-mtd
[-- Attachment #1.1: Type: text/plain, Size: 1652 bytes --]
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(-)
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
[-- Attachment #1.2: 0001-UBIFS-fix-complaints-about-too-small-debug-buffer-si.patch --]
[-- Type: text/x-patch, Size: 1607 bytes --]
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
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply related [flat|nested] 6+ messages in thread