]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
cifs: Ratelimit kernel log messages
authorJamie Bainbridge <jamie.bainbridge@gmail.com>
Sat, 7 Nov 2015 12:13:49 +0000 (22:13 +1000)
committerLuis Henriques <luis.henriques@canonical.com>
Wed, 3 Feb 2016 10:25:06 +0000 (10:25 +0000)
commit ec7147a99e33a9e4abad6fc6e1b40d15df045d53 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: Jamie Bainbridge <jamie.bainbridge@gmail.com>
Signed-off-by: Steve French <smfrench@gmail.com>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
fs/cifs/cifs_debug.c
fs/cifs/cifs_debug.h

index f3ac4154cbb606707956d9fbbd2a64ec553a9ceb..a7e223bbf8df28459aa247818d245f21ce7c362f 100644 (file)
@@ -68,7 +68,7 @@ void cifs_vfs_err(const char *fmt, ...)
        vaf.fmt = fmt;
        vaf.va = &args;
 
-       printk(KERN_ERR "CIFS VFS: %pV", &vaf);
+       pr_err_ratelimited("CIFS VFS: %pV", &vaf);
 
        va_end(args);
 }
index c99b40fb609ba717ea37853182c37d71d785845b..9ebeb6f19c8a97b0e81558932badbdb186c2dbf3 100644 (file)
@@ -51,15 +51,13 @@ __printf(1, 2) void cifs_vfs_err(const char *fmt, ...);
 /* information message: e.g., configuration, major event */
 #define cifs_dbg(type, fmt, ...)                                       \
 do {                                                                   \
-       if (type == FYI) {                                              \
-               if (cifsFYI & CIFS_INFO) {                              \
-                       printk(KERN_DEBUG "%s: " fmt,                   \
-                              __FILE__, ##__VA_ARGS__);                \
-               }                                                       \
+       if (type == FYI && cifsFYI & CIFS_INFO) {                       \
+               pr_debug_ratelimited("%s: "                             \
+                           fmt, __FILE__, ##__VA_ARGS__);              \
        } else if (type == VFS) {                                       \
                cifs_vfs_err(fmt, ##__VA_ARGS__);                       \
        } else if (type == NOISY && type != 0) {                        \
-               printk(KERN_DEBUG fmt, ##__VA_ARGS__);                  \
+               pr_debug_ratelimited(fmt, ##__VA_ARGS__);               \
        }                                                               \
 } while (0)