lkml.org 
[lkml]   [2018]   [Sep]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] scsi: mpt3sas: make sysfs error messages ratelimited
From
Date
On Fri, 2018-09-07 at 11:39 +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> 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.
[]
> diff --git 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;
> }

trivia:

All the uses of MPT3SAS_FMT in drivers/scsi/mpt3sas/ seem
not nice. It obfuscate the format and arguments.

Perhaps better would be create ioc_<level> macros.

\
 
 \ /
  Last update: 2018-09-14 13:27    [W:0.037 / U:0.872 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site