All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Valdis Klētnieks" <valdis.kletnieks@vt.edu>
To: Ian Pilcher <arequipeno@gmail.com>
Cc: linux-block@vger.kernel.org, linux-leds@vger.kernel.org,
	axboe@kernel.dk, pavel@ucw.cz, linux-kernel@vger.kernel.org,
	kernelnewbies@kernelnewbies.org
Subject: Re: [RFC PATCH 3/8] block: Add kernel APIs to create & delete block device LED triggers
Date: Wed, 28 Jul 2021 23:45:34 -0400	[thread overview]
Message-ID: <110419.1627530334@turing-police> (raw)
In-Reply-To: <20210729015344.3366750-4-arequipeno@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1176 bytes --]

On Wed, 28 Jul 2021 20:53:39 -0500, Ian Pilcher said:
> * New file - include/linux/blk-ledtrig.h
>
> Signed-off-by: Ian Pilcher <arequipeno@gmail.com>
> ---
>  block/blk-ledtrig.c         | 152 ++++++++++++++++++++++++++++++++++++
>  include/linux/blk-ledtrig.h |  19 +++++
>  2 files changed, 171 insertions(+)
>  create mode 100644 include/linux/blk-ledtrig.h
>
> diff --git a/block/blk-ledtrig.c b/block/blk-ledtrig.c
> index 345a3b6bdbc6..c69ea1539336 100644
> --- a/block/blk-ledtrig.c
> +++ b/block/blk-ledtrig.c

> +
> +static int __blk_ledtrig_create(const char *const name, const size_t len)

(...)
+	if (blk_ledtrig_find(name, len) != NULL) {
+		pr_warn("blockdev LED trigger named %.*s already exists\n",
+			(int)len, name);

Is pr_warn() the right level for this stuff? I'd think this sort of pilot error should
be pr_info() or even pr_debug(), if mentioned at all.  pr_warn() would be for
something like an unexpected situation like trying to blink an LED but failing.
Simple syntax errors should probably just toss a -EINVAL and return.

(Among other things, this allows a userspace script to spam the
log by simply repeatedly trying to create the same entry)


[-- Attachment #2: Type: application/pgp-signature, Size: 494 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: "Valdis Klētnieks" <valdis.kletnieks@vt.edu>
To: Ian Pilcher <arequipeno@gmail.com>
Cc: axboe@kernel.dk, kernelnewbies@kernelnewbies.org,
	linux-kernel@vger.kernel.org, linux-block@vger.kernel.org,
	pavel@ucw.cz, linux-leds@vger.kernel.org
Subject: Re: [RFC PATCH 3/8] block: Add kernel APIs to create & delete block device LED triggers
Date: Wed, 28 Jul 2021 23:45:34 -0400	[thread overview]
Message-ID: <110419.1627530334@turing-police> (raw)
In-Reply-To: <20210729015344.3366750-4-arequipeno@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1176 bytes --]

On Wed, 28 Jul 2021 20:53:39 -0500, Ian Pilcher said:
> * New file - include/linux/blk-ledtrig.h
>
> Signed-off-by: Ian Pilcher <arequipeno@gmail.com>
> ---
>  block/blk-ledtrig.c         | 152 ++++++++++++++++++++++++++++++++++++
>  include/linux/blk-ledtrig.h |  19 +++++
>  2 files changed, 171 insertions(+)
>  create mode 100644 include/linux/blk-ledtrig.h
>
> diff --git a/block/blk-ledtrig.c b/block/blk-ledtrig.c
> index 345a3b6bdbc6..c69ea1539336 100644
> --- a/block/blk-ledtrig.c
> +++ b/block/blk-ledtrig.c

> +
> +static int __blk_ledtrig_create(const char *const name, const size_t len)

(...)
+	if (blk_ledtrig_find(name, len) != NULL) {
+		pr_warn("blockdev LED trigger named %.*s already exists\n",
+			(int)len, name);

Is pr_warn() the right level for this stuff? I'd think this sort of pilot error should
be pr_info() or even pr_debug(), if mentioned at all.  pr_warn() would be for
something like an unexpected situation like trying to blink an LED but failing.
Simple syntax errors should probably just toss a -EINVAL and return.

(Among other things, this allows a userspace script to spam the
log by simply repeatedly trying to create the same entry)


[-- Attachment #1.2: Type: application/pgp-signature, Size: 494 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

  reply	other threads:[~2021-07-29  3:45 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-29  1:53 [RFC PATCH 0/8] Add configurable block device LED triggers Ian Pilcher
2021-07-29  1:53 ` Ian Pilcher
2021-07-29  1:53 ` [RFC PATCH 1/8] docs: Add block device LED trigger documentation Ian Pilcher
2021-07-29  1:53   ` Ian Pilcher
2021-07-29  3:09   ` Valdis Klētnieks
2021-07-29  3:09     ` Valdis Klētnieks
2021-07-29 15:52     ` Ian Pilcher
2021-07-29 15:52       ` Ian Pilcher
2021-07-30  5:22       ` Greg KH
2021-07-30  5:22         ` Greg KH
2021-07-29  5:53   ` Greg KH
2021-07-29  5:53     ` Greg KH
2021-07-29 11:59   ` Marek Behún
2021-07-29 11:59     ` Marek Behún
2021-07-29 18:03     ` Ian Pilcher
2021-07-29 18:03       ` Ian Pilcher
2021-07-29  1:53 ` [RFC PATCH 2/8] block: Add block device LED trigger list Ian Pilcher
2021-07-29  1:53   ` Ian Pilcher
2021-07-29  3:14   ` Valdis Klētnieks
2021-07-29  3:14     ` Valdis Klētnieks
2021-07-29 15:55     ` Ian Pilcher
2021-07-29 15:55       ` Ian Pilcher
2021-07-29  1:53 ` [RFC PATCH 3/8] block: Add kernel APIs to create & delete block device LED triggers Ian Pilcher
2021-07-29  1:53   ` Ian Pilcher
2021-07-29  3:45   ` Valdis Klētnieks [this message]
2021-07-29  3:45     ` Valdis Klētnieks
2021-07-29 16:16     ` Ian Pilcher
2021-07-29 16:16       ` Ian Pilcher
2021-07-29  5:52   ` Greg KH
2021-07-29  5:52     ` Greg KH
2021-07-29  1:53 ` [RFC PATCH 4/8] block: Add block class attributes to manage LED trigger list Ian Pilcher
2021-07-29  1:53   ` Ian Pilcher
2021-07-29  5:54   ` Greg KH
2021-07-29  5:54     ` Greg KH
2021-07-29  1:53 ` [RFC PATCH 5/8] block: Add block device LED trigger info to struct genhd Ian Pilcher
2021-07-29  1:53   ` Ian Pilcher
2021-07-29  1:53 ` [RFC PATCH 6/8] block: Add kernel APIs to set & clear per-block device LED triggers Ian Pilcher
2021-07-29  1:53   ` Ian Pilcher
2021-07-29  1:53 ` [RFC PATCH 7/8] block: Add block device attributes to set & clear " Ian Pilcher
2021-07-29  1:53   ` Ian Pilcher
2021-07-29  1:53 ` [RFC PATCH 8/8] block: Blink device LED when request is sent to low-level driver Ian Pilcher
2021-07-29  1:53   ` Ian Pilcher
2021-07-29  8:54 ` [RFC PATCH 0/8] Add configurable block device LED triggers Pavel Machek
2021-07-29  8:54   ` Pavel Machek
2021-07-29 17:03   ` Ian Pilcher
2021-07-29 17:03     ` Ian Pilcher
2021-07-29 18:35     ` Pavel Machek
2021-07-29 18:35       ` Pavel Machek
2021-07-29 19:14       ` Ian Pilcher
2021-07-29 19:14         ` Ian Pilcher

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=110419.1627530334@turing-police \
    --to=valdis.kletnieks@vt.edu \
    --cc=arequipeno@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=kernelnewbies@kernelnewbies.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.