lkml.org 
[lkml]   [2021]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [RFC PATCH 3/8] block: Add kernel APIs to create & delete block device LED triggers
Date
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)

[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2021-07-29 05:47    [W:0.143 / U:0.928 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site