From 93d8c8162d1f1cfc9c20fd3d41c7def563ebfd18 Mon Sep 17 00:00:00 2001 From: Devin Kim Date: Wed, 8 Jan 2014 12:57:37 -0800 Subject: [PATCH] fs/dcache.c: Fix the too small buffer for dname temp[64] is used for internal temporary buffer in dynamic_dname(). This is for dname. But It's too small. dname's size may be > 64. In that case, it returns as -ENAMETOOLONG. So Increase the buffer size to 256 for avoiding this issue. The following was caused by the small buffer. WARNING: at /kernel/mm/page_alloc.c:2470 __alloc_pages_nodemask+0x24c/0x938() CPU: 2 PID: 505 Comm: android.bg Not tainted 3.10.0-g2f73780-00003-g2ff41d9-dirty #13 [] (unwind_backtrace+0x0/0x11c) from [] (show_stack+0x10/0x14) [] (show_stack+0x10/0x14) from [] (warn_slowpath_common+0x48/0x68) [] (warn_slowpath_common+0x48/0x68) from [] (warn_slowpath_null+0x18/0x20) [] (warn_slowpath_null+0x18/0x20) from [] (__alloc_pages_nodemask+0x24c/0x938) [] (__alloc_pages_nodemask+0x24c/0x938) from [] (__get_free_pages+0x10/0x24) [] (__get_free_pages+0x10/0x24) from [] (kmalloc_order_trace+0x24/0xf0) [] (kmalloc_order_trace+0x24/0xf0) from [] (__kmalloc+0x30/0x244) [] (__kmalloc+0x30/0x244) from [] (seq_read+0x270/0x464) [] (seq_read+0x270/0x464) from [] (vfs_read+0xa4/0x134) [] (vfs_read+0xa4/0x134) from [] (SyS_read+0x38/0x68) [] (SyS_read+0x38/0x68) from [] (ret_fast_syscall+0x0/0x30) Change-Id: I74f5217ba3c4be73e91f33f900f1f0c26810cc05 Signed-off-by: Devin Kim --- fs/dcache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/dcache.c b/fs/dcache.c index 91851d1ae68..48f701c8bed 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -2715,7 +2715,7 @@ char *dynamic_dname(struct dentry *dentry, char *buffer, int buflen, const char *fmt, ...) { va_list args; - char temp[64]; + char temp[256]; int sz; va_start(args, fmt);