Skip to content

Commit

Permalink
cifs: Ratelimit kernel log messages
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
superjamie authored and Steve French committed Jan 14, 2016
1 parent 7fdec82 commit ec7147a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion fs/cifs/cifs_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void cifs_vfs_err(const char *fmt, ...)
vaf.fmt = fmt;
vaf.va = &args;

pr_err("CIFS VFS: %pV", &vaf);
pr_err_ratelimited("CIFS VFS: %pV", &vaf);

va_end(args);
}
Expand Down
9 changes: 4 additions & 5 deletions fs/cifs/cifs_debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +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) { \
pr_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) { \
pr_debug(fmt, ##__VA_ARGS__); \
pr_debug_ratelimited(fmt, ##__VA_ARGS__); \
} \
} while (0)

Expand Down

0 comments on commit ec7147a

Please sign in to comment.