From patchwork Fri Sep 7 10:39:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin King X-Patchwork-Id: 10592053 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2FD2514E0 for ; Fri, 7 Sep 2018 10:39:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 205AE2AE24 for ; Fri, 7 Sep 2018 10:39:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 11B0A2AE2B; Fri, 7 Sep 2018 10:39:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E05522AE29 for ; Fri, 7 Sep 2018 10:39:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728491AbeIGPTt (ORCPT ); Fri, 7 Sep 2018 11:19:49 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:40639 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726032AbeIGPTt (ORCPT ); Fri, 7 Sep 2018 11:19:49 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1fyEAf-00031v-68; Fri, 07 Sep 2018 10:39:25 +0000 From: Colin King To: Sathya Prakash , Chaitra P B , Suganath Prabu Subramani , "James E . J . Bottomley" , "Martin K . Petersen" , MPT-FusionLinux.pdl@broadcom.com, linux-scsi@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] scsi: mpt3sas: make sysfs error messages ratelimited Date: Fri, 7 Sep 2018 11:39:24 +0100 Message-Id: <20180907103924.17598-1-colin.king@canonical.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Colin Ian King It is possible to heavily spam the kernel logs with messages by excessive reading of the mpt3sas sysfs files. Make the error messages ratelimited to reduce the spamming effect. Signed-off-by: Colin Ian King --- drivers/scsi/mpt3sas/mpt3sas_ctl.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_ctl.c b/drivers/scsi/mpt3sas/mpt3sas_ctl.c index 5e8c059ce2c9..656cec5adb17 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_ctl.c +++ b/drivers/scsi/mpt3sas/mpt3sas_ctl.c @@ -2958,7 +2958,7 @@ _ctl_BRM_status_show(struct device *cdev, struct device_attribute *attr, ssize_t rc = 0; if (!ioc->is_warpdrive) { - pr_err(MPT3SAS_FMT "%s: BRM attribute is only for" + pr_err_ratelimited(MPT3SAS_FMT "%s: BRM attribute is only for" " warpdrive\n", ioc->name, __func__); goto out; } @@ -3039,7 +3039,7 @@ _ctl_host_trace_buffer_size_show(struct device *cdev, struct DIAG_BUFFER_START *request_data; if (!ioc->diag_buffer[MPI2_DIAG_BUF_TYPE_TRACE]) { - pr_err(MPT3SAS_FMT + pr_err_ratelimited(MPT3SAS_FMT "%s: host_trace_buffer is not registered\n", ioc->name, __func__); return 0; @@ -3047,7 +3047,7 @@ _ctl_host_trace_buffer_size_show(struct device *cdev, if ((ioc->diag_buffer_status[MPI2_DIAG_BUF_TYPE_TRACE] & MPT3_DIAG_BUFFER_IS_REGISTERED) == 0) { - pr_err(MPT3SAS_FMT + pr_err_ratelimited(MPT3SAS_FMT "%s: host_trace_buffer is not registered\n", ioc->name, __func__); return 0; @@ -3089,7 +3089,7 @@ _ctl_host_trace_buffer_show(struct device *cdev, struct device_attribute *attr, u32 size; if (!ioc->diag_buffer[MPI2_DIAG_BUF_TYPE_TRACE]) { - pr_err(MPT3SAS_FMT + pr_err_ratelimited(MPT3SAS_FMT "%s: host_trace_buffer is not registered\n", ioc->name, __func__); return 0; @@ -3097,7 +3097,7 @@ _ctl_host_trace_buffer_show(struct device *cdev, struct device_attribute *attr, if ((ioc->diag_buffer_status[MPI2_DIAG_BUF_TYPE_TRACE] & MPT3_DIAG_BUFFER_IS_REGISTERED) == 0) { - pr_err(MPT3SAS_FMT + pr_err_ratelimited(MPT3SAS_FMT "%s: host_trace_buffer is not registered\n", ioc->name, __func__); return 0;