From: David Lechner <david@lechnology.com>
To: Sebastian Reichel <sre@kernel.org>, linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] power_supply: sysfs: ratelimit property read error message
Date: Wed, 12 Sep 2018 19:51:03 -0500 [thread overview]
Message-ID: <fa60b825-cd9e-91d7-c422-ee3b147d68c1@lechnology.com> (raw)
In-Reply-To: <20180913004830.1265-1-david@lechnology.com>
On 09/12/2018 07:48 PM, David Lechner wrote:
> This adds ratelimiting to the message that is printed when reading a
> power supply property via sysfs returns an error. This will prevent
> userspace applications from unintentionally dDOSing the system by
> continuosuly reading a property that returns an error.
s/continuosuly/continuously/
>
> Signed-off-by: David Lechner <david@lechnology.com>
> ---
> drivers/power/supply/power_supply_sysfs.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c
> index 6170ed8b6854..dce24f596160 100644
> --- a/drivers/power/supply/power_supply_sysfs.c
> +++ b/drivers/power/supply/power_supply_sysfs.c
> @@ -131,7 +131,8 @@ static ssize_t power_supply_show_property(struct device *dev,
> dev_dbg(dev, "driver has no data for `%s' property\n",
> attr->attr.name);
> else if (ret != -ENODEV && ret != -EAGAIN)
> - dev_err(dev, "driver failed to report `%s' property: %zd\n",
> + dev_err_ratelimited(dev,
> + "driver failed to report `%s' property: %zd\n",
> attr->attr.name, ret);
> return ret;
> }
>
next prev parent reply other threads:[~2018-09-13 0:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-13 0:48 David Lechner
2018-09-13 0:51 ` David Lechner [this message]
2018-09-16 9:34 ` Sebastian Reichel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fa60b825-cd9e-91d7-c422-ee3b147d68c1@lechnology.com \
--to=david@lechnology.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=sre@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®