Commit 1acdf404 authored by Jamie Bainbridge's avatar Jamie Bainbridge Committed by Luis Henriques

cifs: Ratelimit kernel log messages

commit ec7147a9 upstream.

Under some conditions, CIFS can repeatedly call the cifs_dbg() logging
wrapper. If done rapidly enough, the console framebuffer can softlockup
or "rcu_sched self-detected stall". Apply the built-in log ratelimiters
to prevent such hangs.
Signed-off-by: default avatarJamie Bainbridge <jamie.bainbridge@gmail.com>
Signed-off-by: default avatarSteve French <smfrench@gmail.com>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent cc8e8d92
...@@ -68,7 +68,7 @@ void cifs_vfs_err(const char *fmt, ...) ...@@ -68,7 +68,7 @@ void cifs_vfs_err(const char *fmt, ...)
vaf.fmt = fmt; vaf.fmt = fmt;
vaf.va = &args; vaf.va = &args;
printk(KERN_ERR "CIFS VFS: %pV", &vaf); pr_err_ratelimited("CIFS VFS: %pV", &vaf);
va_end(args); va_end(args);
} }
......
...@@ -51,15 +51,13 @@ __printf(1, 2) void cifs_vfs_err(const char *fmt, ...); ...@@ -51,15 +51,13 @@ __printf(1, 2) void cifs_vfs_err(const char *fmt, ...);
/* information message: e.g., configuration, major event */ /* information message: e.g., configuration, major event */
#define cifs_dbg(type, fmt, ...) \ #define cifs_dbg(type, fmt, ...) \
do { \ do { \
if (type == FYI) { \ if (type == FYI && cifsFYI & CIFS_INFO) { \
if (cifsFYI & CIFS_INFO) { \ pr_debug_ratelimited("%s: " \
printk(KERN_DEBUG "%s: " fmt, \ fmt, __FILE__, ##__VA_ARGS__); \
__FILE__, ##__VA_ARGS__); \
} \
} else if (type == VFS) { \ } else if (type == VFS) { \
cifs_vfs_err(fmt, ##__VA_ARGS__); \ cifs_vfs_err(fmt, ##__VA_ARGS__); \
} else if (type == NOISY && type != 0) { \ } else if (type == NOISY && type != 0) { \
printk(KERN_DEBUG fmt, ##__VA_ARGS__); \ pr_debug_ratelimited(fmt, ##__VA_ARGS__); \
} \ } \
} while (0) } while (0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment