From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933203AbcBIAD4 (ORCPT ); Mon, 8 Feb 2016 19:03:56 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:59853 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932277AbcBHXyk (ORCPT ); Mon, 8 Feb 2016 18:54:40 -0500 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Jamie Bainbridge" , "Steve French" Date: Mon, 08 Feb 2016 23:53:51 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.2 50/87] cifs: Ratelimit kernel log messages In-Reply-To: X-SA-Exim-Connect-IP: 2a02:8011:400e:2:a11:96ff:fe28:a980 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.2.77-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Jamie Bainbridge 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 Signed-off-by: Steve French [bwh: Backported to 3.2: - cifs_dbg() and cifs_vfs_err() do not exist, but make similar changes to cifsfyi(), cifswarn() and cifserror()] - Include explicitly] Signed-off-by: Ben Hutchings --- fs/cifs/cifs_debug.c | 2 +- fs/cifs/cifs_debug.h | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) --- a/fs/cifs/cifs_debug.h +++ b/fs/cifs/cifs_debug.h @@ -23,6 +23,8 @@ #ifndef _H_CIFS_DEBUG #define _H_CIFS_DEBUG +#include + void cifs_dump_mem(char *label, void *data, int length); #ifdef CONFIG_CIFS_DEBUG2 #define DBG2 2 @@ -48,7 +50,7 @@ extern int cifsFYI; #define cifsfyi(fmt, arg...) \ do { \ if (cifsFYI & CIFS_INFO) \ - printk(KERN_DEBUG "%s: " fmt "\n", __FILE__, ##arg); \ + pr_debug_ratelimited("%s: " fmt "\n", __FILE__, ##arg); \ } while (0) #define cFYI(set, fmt, arg...) \ @@ -58,7 +60,7 @@ do { \ } while (0) #define cifswarn(fmt, arg...) \ - printk(KERN_WARNING fmt "\n", ##arg) + pr_warn_ratelimited(fmt "\n", ##arg) /* debug event message: */ extern int cifsERROR; @@ -73,7 +75,7 @@ do { \ #define cifserror(fmt, arg...) \ do { \ if (cifsERROR) \ - printk(KERN_ERR "CIFS VFS: " fmt "\n", ##arg); \ + pr_err_ratelimited("CIFS VFS: " fmt "\n", ##arg); \ } while (0) #define cERROR(set, fmt, arg...) \