Skip to content

Commit ec7147a

Browse files
superjamieSteve French
authored andcommitted
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 <[email protected]> Signed-off-by: Steve French <[email protected]> CC: Stable <[email protected]>
1 parent 7fdec82 commit ec7147a

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

fs/cifs/cifs_debug.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void cifs_vfs_err(const char *fmt, ...)
5050
vaf.fmt = fmt;
5151
vaf.va = &args;
5252

53-
pr_err("CIFS VFS: %pV", &vaf);
53+
pr_err_ratelimited("CIFS VFS: %pV", &vaf);
5454

5555
va_end(args);
5656
}

fs/cifs/cifs_debug.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,13 @@ __printf(1, 2) void cifs_vfs_err(const char *fmt, ...);
5151
/* information message: e.g., configuration, major event */
5252
#define cifs_dbg(type, fmt, ...) \
5353
do { \
54-
if (type == FYI) { \
55-
if (cifsFYI & CIFS_INFO) { \
56-
pr_debug("%s: " fmt, __FILE__, ##__VA_ARGS__); \
57-
} \
54+
if (type == FYI && cifsFYI & CIFS_INFO) { \
55+
pr_debug_ratelimited("%s: " \
56+
fmt, __FILE__, ##__VA_ARGS__); \
5857
} else if (type == VFS) { \
5958
cifs_vfs_err(fmt, ##__VA_ARGS__); \
6059
} else if (type == NOISY && type != 0) { \
61-
pr_debug(fmt, ##__VA_ARGS__); \
60+
pr_debug_ratelimited(fmt, ##__VA_ARGS__); \
6261
} \
6362
} while (0)
6463

0 commit comments

Comments
 (0)