]> Pileus Git - ~andy/linux/commitdiff
UBIFS: fix complaints about too small debug buffer size
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Tue, 21 Aug 2012 18:50:58 +0000 (21:50 +0300)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Wed, 22 Aug 2012 08:51:33 +0000 (11:51 +0300)
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>
Tested-by: Michael Hench <michaelhench@gmail.com>
Cc: stable@vger.kernel.org [v3.3+]
fs/ubifs/debug.h

index 8b8cc4e945f4014bd8e0a77d1d9bde0197f0fa76..760de723dadb4928eec6f9c4729245a40dcce5de 100644 (file)
@@ -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__,             \