summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/super.c
diff options
context:
space:
mode:
authorDaniel Yang <danielyangkang@gmail.com>2024-11-18 08:01:40 +0100
committerJaegeuk Kim <jaegeuk@kernel.org>2024-11-21 17:12:29 +0100
commit789ca0eb47f7782b3230ab0957eabd7967b78cae (patch)
tree1aea3f40cedb4ff13cc5238b9e8794069e3e3be0 /fs/f2fs/super.c
parentRevert "f2fs: remove unreachable lazytime mount option parsing" (diff)
downloadlinux-789ca0eb47f7782b3230ab0957eabd7967b78cae.tar.xz
linux-789ca0eb47f7782b3230ab0957eabd7967b78cae.zip
f2fs: replace deprecated strcpy with strscpy
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. Signed-off-by: Daniel Yang <danielyangkang@gmail.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to '')
-rw-r--r--fs/f2fs/super.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 35c4394e4fc6..7bcd6471af9a 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -1172,7 +1172,11 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
break;
}
- strcpy(ext[ext_cnt], name);
+ ret = strscpy(ext[ext_cnt], name);
+ if (ret < 0) {
+ kfree(name);
+ return ret;
+ }
F2FS_OPTION(sbi).compress_ext_cnt++;
kfree(name);
break;
@@ -1201,7 +1205,11 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
break;
}
- strcpy(noext[noext_cnt], name);
+ ret = strscpy(noext[noext_cnt], name);
+ if (ret < 0) {
+ kfree(name);
+ return ret;
+ }
F2FS_OPTION(sbi).nocompress_ext_cnt++;
kfree(name);
break;