All of lore.kernel.org
 help / color / mirror / Atom feed
* new 3.5.2 ubifs debug assert
@ 2012-08-20 18:09 Michael Hench
  2012-08-20 19:15 ` Artem Bityutskiy
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Michael Hench @ 2012-08-20 18:09 UTC (permalink / raw)
  To: linux-mtd

apparently UBIFS debugging is always on in 3.5.2
can anyone tell me what this means ?

UBIFS assert failed in dbg_snprintf_key at 136 (pid 28692)


everything seems to work, just lots of debug messages.
this partition hasn't changed in quite some time over several kernel versions.

Thanks.
Mike Hench

^ permalink raw reply	[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
  2 siblings, 0 replies; 6+ messages in thread
From: Artem Bityutskiy @ 2012-08-20 19:15 UTC (permalink / raw)
  To: MichaelHench; +Cc: linux-mtd

[-- Attachment #1: Type: text/plain, Size: 506 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 ?
> 
> UBIFS assert failed in dbg_snprintf_key at 136 (pid 28692)
> 
> 
> everything seems to work, just lots of debug messages.
> this partition hasn't changed in quite some time over several kernel versions.

Could you please send a couple of warnings fully, with the stack dumps.
I'll try to prepare a fix.

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[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
  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

* Re: new 3.5.2 ubifs debug assert
  2012-08-21 19:03 ` Artem Bityutskiy
@ 2012-08-21 19:44   ` Michael Hench
  2012-08-22  8:51     ` Artem Bityutskiy
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Hench @ 2012-08-21 19:44 UTC (permalink / raw)
  To: dedekind1; +Cc: linux-mtd

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

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

* Re: new 3.5.2 ubifs debug assert
  2012-08-21 19:44   ` Michael Hench
@ 2012-08-22  8:51     ` Artem Bityutskiy
  0 siblings, 0 replies; 6+ messages in thread
From: Artem Bityutskiy @ 2012-08-22  8:51 UTC (permalink / raw)
  To: MichaelHench; +Cc: linux-mtd

[-- Attachment #1: Type: text/plain, Size: 434 bytes --]

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!

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

end of thread, other threads:[~2012-08-22  8:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2012-08-22  8:51     ` Artem Bityutskiy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.