aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJamie Bainbridge <jamie.bainbridge@gmail.com>2015-11-07 07:13:49 -0500
committerSteve French <sfrench@localhost.localdomain>2016-01-14 14:39:02 -0500
commitec7147a99e33a9e4abad6fc6e1b40d15df045d53 (patch)
tree0bb16e11803e1136004e2077161ad65861f537bb /fs
parent7fdec82af6a9e190e53d07a1463d2a9ac49a8750 (diff)
cifs: Ratelimit kernel log messages
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: Jamie Bainbridge <jamie.bainbridge@gmail.com> Signed-off-by: Steve French <smfrench@gmail.com> CC: Stable <stable@vger.kernel.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/cifs_debug.c2
-rw-r--r--fs/cifs/cifs_debug.h9
2 files changed, 5 insertions, 6 deletions
diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
index 7febcf2475c5..50b268483302 100644
--- a/fs/cifs/cifs_debug.c
+++ b/fs/cifs/cifs_debug.c
@@ -50,7 +50,7 @@ void cifs_vfs_err(const char *fmt, ...)
50 vaf.fmt = fmt; 50 vaf.fmt = fmt;
51 vaf.va = &args; 51 vaf.va = &args;
52 52
53 pr_err("CIFS VFS: %pV", &vaf); 53 pr_err_ratelimited("CIFS VFS: %pV", &vaf);
54 54
55 va_end(args); 55 va_end(args);
56} 56}
diff --git a/fs/cifs/cifs_debug.h b/fs/cifs/cifs_debug.h
index f40fbaca1b2a..66cf0f9fff89 100644
--- a/fs/cifs/cifs_debug.h
+++ b/fs/cifs/cifs_debug.h
@@ -51,14 +51,13 @@ __printf(1, 2) void cifs_vfs_err(const char *fmt, ...);
51/* information message: e.g., configuration, major event */ 51/* information message: e.g., configuration, major event */
52#define cifs_dbg(type, fmt, ...) \ 52#define cifs_dbg(type, fmt, ...) \
53do { \ 53do { \
54 if (type == FYI) { \ 54 if (type == FYI && cifsFYI & CIFS_INFO) { \
55 if (cifsFYI & CIFS_INFO) { \ 55 pr_debug_ratelimited("%s: " \
56 pr_debug("%s: " fmt, __FILE__, ##__VA_ARGS__); \ 56 fmt, __FILE__, ##__VA_ARGS__); \
57 } \
58 } else if (type == VFS) { \ 57 } else if (type == VFS) { \
59 cifs_vfs_err(fmt, ##__VA_ARGS__); \ 58 cifs_vfs_err(fmt, ##__VA_ARGS__); \
60 } else if (type == NOISY && type != 0) { \ 59 } else if (type == NOISY && type != 0) { \
61 pr_debug(fmt, ##__VA_ARGS__); \ 60 pr_debug_ratelimited(fmt, ##__VA_ARGS__); \
62 } \ 61 } \
63} while (0) 62} while (0)
64 63