Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3236190imm; Sun, 16 Sep 2018 13:03:30 -0700 (PDT) X-Google-Smtp-Source: ANB0Vda4XZ8mTMS9PzJLQlLo0/sU42NblE8IGdYLADflPaUl1wJVY7ESDXA634IQJvBHHIRx5UOY X-Received: by 2002:a17:902:6b0b:: with SMTP id o11-v6mr21848286plk.214.1537128210573; Sun, 16 Sep 2018 13:03:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537128210; cv=none; d=google.com; s=arc-20160816; b=n9aEc3uyngY/smxztCRdcsc/S1dzobhU20zUdmcr1ykFhzuz1yS1Cw0sguYfUThBAY //nk1hDbtR50gnnkix4ldSw4xOHO++6LE1/MB0zo2qLljlvYLGQ1BT4u1osZdakhkwAk KUz8lacwCqzFu7aN0dRsbGASPWp+M6dUtvkPNdJD6rPmjlSJphOQW7NNCZcUMn+GDOpH 4RtWMEcTaLwwoeyblMezXYXfIllbqG1OF7ZMXkGFTEya1pUSX+duLJtuG3toMS4SkY8c tiVRGHz9AqXw7kIsblTKh9x0ZhdUcY4knZiAcHKgccHuSjWliEcyB1qcqyBH/leyD4fO 4s5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=B5IyfLtUZrDVnCKveqzKv02BDbLTVMQ7Lj6wXTXYXOw=; b=dNB5kBgrXugWA6fXfee4IhW7fmUlmcSBYmx80A4SmwW1DRD9h6K3x7Tdu2CssE7PvP rqDj95b1u0H3kL04A45NuUd3oo3xFzVe/9qs1YiXLWX35l/StUBwGOjQLt6+Nl4MPi2N xqA6AvoQQNhvDboryJOW1Cz5eZyIxc7PAFkAcJMPEz/OZzDSjwIWfquicUNO3tEjPH4k nUwTzt2NIs/RShSIy4GlcRVq09UmZ7/BFl+OQmF79wgSTWC22BcU2cM6y0DJ8z2bmpuS 6VwEopC6hz9WhoaALuRg8kEw5OIkuahZ+GLfz2IODG3QJIIF5vP0sGuFaDZp191a7Cq/ N5ow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x128-v6si14489138pfd.246.2018.09.16.13.03.15; Sun, 16 Sep 2018 13:03:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728709AbeIQB0q (ORCPT + 99 others); Sun, 16 Sep 2018 21:26:46 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:47108 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728567AbeIQB0o (ORCPT ); Sun, 16 Sep 2018 21:26:44 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sre) with ESMTPSA id 9FF5E27DB34 Received: by earth.universe (Postfix, from userid 1000) id 8DAF53C0C3D; Sun, 16 Sep 2018 11:34:18 +0200 (CEST) Date: Sun, 16 Sep 2018 11:34:18 +0200 From: Sebastian Reichel To: David Lechner Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] power_supply: sysfs: ratelimit property read error message Message-ID: <20180916093418.ysblsx6hm2xjndyr@earth.universe> References: <20180913004830.1265-1-david@lechnology.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="t5twzgmypjd2fkjq" Content-Disposition: inline In-Reply-To: <20180913004830.1265-1-david@lechnology.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --t5twzgmypjd2fkjq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Wed, Sep 12, 2018 at 07:48:30PM -0500, 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. >=20 > Signed-off-by: David Lechner > --- Thanks, queued. -- Sebastian > drivers/power/supply/power_supply_sysfs.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/su= pply/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 devi= ce *dev, > dev_dbg(dev, "driver has no data for `%s' property\n", > attr->attr.name); > else if (ret !=3D -ENODEV && ret !=3D -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; > } > --=20 > 2.17.1 >=20 --t5twzgmypjd2fkjq Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAlueI5cACgkQ2O7X88g7 +ppTNA/8DGN3fiWvUrFzSicgIZG4E/fb1jo065u6FHSK5X1qDJxcXyrHAlN7prLr hqVxJI3x6XhkLQAQrk48MnwtYXKQqZn6TIHAveFJ5evnmcnsD2j/HE5R5PNxTGUP P9eKSlVfB07YW0LOJW2AYDVonVjG93ZGCLiAcZE92fa+YTs9pkHyCeqpHQSrPIdM e7rbu94aSqUtCkrIWtTECyn5uV531O5KvRG3CpC/GGGB2Hi8QNTKFrU9J35V7TXT qwbn4o3BA9JW2jxeQVKa1VmvS2sHMw2O8C2sTG0jCYaBcCRVUQGaX/t6wAlajorp 7jYUuf6nj+zepN02cmNpb2IBkM2NWpXDsihL3e/A8G/S/iUhp1BWkVyKVqO53cyU aS7hk4r/j3SyFoK2jKo9fnoUV6zIljaCCvLhKG5aGM1GTZ9sJQS2GgQihs8bzdjE uFQNXMUUKo+1hY4xgNB1nAEtn279JQWBB3ypdMh4fIOwyAH1ziO7BLMmcgkJu5lM g2edFpeCgMvhE7H4jz16rV5KMK6bxyRhObcI0yZ9UpR2HPRjvmH7K+rK2Ad7hpDo dtd62QBSSx8j9cra+DEeozycBK4M2fbJYVXVIXondHcqs8FYvOEhPXWO9AeRIErR aFKjrOdVT+YXShaB/gFZOMk3re6QPuZV1Rmlie7NegtUSfUmmeE= =bB9D -----END PGP SIGNATURE----- --t5twzgmypjd2fkjq--