[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a6d3e3a8-f0a6-dffc-c3b6-45d81efc7664@linbit.com>
Date: Fri, 19 Aug 2022 17:24:50 +0200
From: Christoph Böhmwalder
<christoph.boehmwalder@...bit.com>
To: Wolfram Sang <wsa+renesas@...g-engineering.com>
Cc: Jens Axboe <axboe@...nel.dk>,
Philipp Reisner <philipp.reisner@...bit.com>,
Lars Ellenberg <lars.ellenberg@...bit.com>,
Geoff Levand <geoff@...radead.org>, Jim Paris <jim@...n.com>,
Michael Ellerman <mpe@...erman.id.au>,
Nicholas Piggin <npiggin@...il.com>,
Christophe Leroy <christophe.leroy@...roup.eu>,
Minchan Kim <minchan@...nel.org>,
Nitin Gupta <ngupta@...are.org>,
Sergey Senozhatsky <senozhatsky@...omium.org>,
linux-block@...r.kernel.org, drbd-dev@...ts.linbit.com,
linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] block: move from strlcpy with unused retval to strscpy
Am 18.08.22 um 22:59 schrieb Wolfram Sang:
> Follow the advice of the below link and prefer 'strscpy' in this
> subsystem. Conversion is 1:1 because the return value is not used.
> Generated by a coccinelle script.
>
> Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/
> Signed-off-by: Wolfram Sang <wsa+renesas@...g-engineering.com>
> ---
> drivers/block/brd.c | 2 +-
> drivers/block/drbd/drbd_nl.c | 2 +-
For the drbd part:
Acked-by: Christoph Böhmwalder <christoph.boehmwalder@...bit.com>
> drivers/block/mtip32xx/mtip32xx.c | 12 ++++++------
> drivers/block/ps3vram.c | 2 +-
> drivers/block/zram/zram_drv.c | 6 +++---
> 5 files changed, 12 insertions(+), 12 deletions(-)
...
> diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
> index 013d355a2033..864c98e74875 100644
> --- a/drivers/block/drbd/drbd_nl.c
> +++ b/drivers/block/drbd/drbd_nl.c
> @@ -4752,7 +4752,7 @@ void notify_helper(enum drbd_notification_type type,
> struct drbd_genlmsghdr *dh;
> int err;
>
> - strlcpy(helper_info.helper_name, name, sizeof(helper_info.helper_name));
> + strscpy(helper_info.helper_name, name, sizeof(helper_info.helper_name));
> helper_info.helper_name_len = min(strlen(name), sizeof(helper_info.helper_name));
> helper_info.helper_status = status;
>
--
Christoph Böhmwalder
LINBIT | Keeping the Digital World Running
DRBD HA — Disaster Recovery — Software defined Storage
Powered by blists - more mailing lists