diff options
author | Max Krummenacher <max.krummenacher@toradex.com> | 2024-02-29 21:24:13 +0100 |
---|---|---|
committer | Max Krummenacher <max.krummenacher@toradex.com> | 2024-02-29 21:24:26 +0100 |
commit | 99e9ab88844a2a2e1c048264315eb0d72eb0bf88 (patch) | |
tree | 0d89b05b1816b8cac1be77ac9b3c297762502e67 /fs/f2fs/super.c | |
parent | 756e3199ba82d68ba07e5acf555d13aaa1da3da1 (diff) | |
parent | d761b18f6bc83bce94251467e3c0974243318456 (diff) |
Merge remote-tracking branch 'fslc/5.15-2.2.x-imx' into toradex_5.15-2.2.x-imx
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Conflicts:
drivers/gpu/drm/bridge/lontium-lt8912b.c
drivers/usb/dwc3/drd.c
Diffstat (limited to 'fs/f2fs/super.c')
-rw-r--r-- | fs/f2fs/super.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 5c0b2b300aa1..d4a76c2deb80 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -540,6 +540,29 @@ static int f2fs_set_test_dummy_encryption(struct super_block *sb, } #ifdef CONFIG_F2FS_FS_COMPRESSION +static bool is_compress_extension_exist(struct f2fs_sb_info *sbi, + const char *new_ext, bool is_ext) +{ + unsigned char (*ext)[F2FS_EXTENSION_LEN]; + int ext_cnt; + int i; + + if (is_ext) { + ext = F2FS_OPTION(sbi).extensions; + ext_cnt = F2FS_OPTION(sbi).compress_ext_cnt; + } else { + ext = F2FS_OPTION(sbi).noextensions; + ext_cnt = F2FS_OPTION(sbi).nocompress_ext_cnt; + } + + for (i = 0; i < ext_cnt; i++) { + if (!strcasecmp(new_ext, ext[i])) + return true; + } + + return false; +} + /* * 1. The same extension name cannot not appear in both compress and non-compress extension * at the same time. @@ -1154,6 +1177,11 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount) return -EINVAL; } + if (is_compress_extension_exist(sbi, name, true)) { + kfree(name); + break; + } + strcpy(ext[ext_cnt], name); F2FS_OPTION(sbi).compress_ext_cnt++; kfree(name); @@ -1178,6 +1206,11 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount) return -EINVAL; } + if (is_compress_extension_exist(sbi, name, false)) { + kfree(name); + break; + } + strcpy(noext[noext_cnt], name); F2FS_OPTION(sbi).nocompress_ext_cnt++; kfree(name); |