[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a1471ca1-e119-4106-8965-cd954c373a62@kernel.org>
Date: Fri, 8 Nov 2024 17:46:54 +0800
From: Chao Yu <chao@...nel.org>
To: Daniel Yang <danielyangkang@...il.com>, Jaegeuk Kim <jaegeuk@...nel.org>,
"open list:F2FS FILE SYSTEM" <linux-f2fs-devel@...ts.sourceforge.net>,
open list <linux-kernel@...r.kernel.org>
Cc: Chao Yu <chao@...nel.org>
Subject: Re: [PATCH] parse_options(): replace deprecated strcpy with strscpy
On 2024/11/6 10:58, Daniel Yang wrote:
> strcpy is deprecated. Kernel docs recommend replacing strcpy with
> strscpy. The function strcpy() return value isn't used so there
> shouldn't be an issue replacing with the safer alternative strscpy.
It's better to add "f2fs: " prefix for commit title.
>
> Signed-off-by: Daniel Yang <danielyangkang@...il.com>
> ---
> fs/f2fs/super.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
> index 87ab5696b..ee8861b95 100644
> --- a/fs/f2fs/super.c
> +++ b/fs/f2fs/super.c
> @@ -1158,7 +1158,7 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
> break;
> }
>
> - strcpy(ext[ext_cnt], name);
> + strscpy(ext[ext_cnt], name);
Needs to handle return value of strscpy()?
> F2FS_OPTION(sbi).compress_ext_cnt++;
> kfree(name);
> break;
> @@ -1187,7 +1187,7 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
> break;
> }
>
> - strcpy(noext[noext_cnt], name);
> + strscpy(noext[noext_cnt], name);
Ditto,
Thanks,
> F2FS_OPTION(sbi).nocompress_ext_cnt++;
> kfree(name);
> break;
Powered by blists - more mailing lists