summaryrefslogtreecommitdiff
path: root/fs/ext4/super.c
diff options
context:
space:
mode:
authorLukas Czerner <lczerner@redhat.com>2021-10-27 17:18:47 +0300
committerTheodore Ts'o <tytso@mit.edu>2021-12-09 22:11:07 +0300
commit4c94bff967d90e91ace38a9886c1c7777a9c6f91 (patch)
tree0cf128ac3051b3e0f562dd0e7346a78175d23b7e /fs/ext4/super.c
parente5a185c26c11cbd1d386be8ee4c5e57b4f62273a (diff)
downloadlinux-4c94bff967d90e91ace38a9886c1c7777a9c6f91.tar.xz
ext4: move option validation to a separate function
Move option validation out of parse_options() into a separate function ext4_validate_options(). Signed-off-by: Lukas Czerner <lczerner@redhat.com> Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com> Link: https://lore.kernel.org/r/20211027141857.33657-4-lczerner@redhat.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r--fs/ext4/super.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index fb596493513d..e62187b77b4a 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -88,6 +88,7 @@ static void ext4_unregister_li_request(struct super_block *sb);
static void ext4_clear_request_list(void);
static struct inode *ext4_get_journal_inode(struct super_block *sb,
unsigned int journal_inum);
+static int ext4_validate_options(struct super_block *sb);
/*
* Lock ordering
@@ -2582,10 +2583,9 @@ static int parse_options(char *options, struct super_block *sb,
struct ext4_parsed_options *ret_opts,
int is_remount)
{
- struct ext4_sb_info __maybe_unused *sbi = EXT4_SB(sb);
- char *p, __maybe_unused *usr_qf_name, __maybe_unused *grp_qf_name;
substring_t args[MAX_OPT_ARGS];
int token;
+ char *p;
if (!options)
return 1;
@@ -2603,7 +2603,14 @@ static int parse_options(char *options, struct super_block *sb,
is_remount) < 0)
return 0;
}
+ return ext4_validate_options(sb);
+}
+
+static int ext4_validate_options(struct super_block *sb)
+{
+ struct ext4_sb_info *sbi = EXT4_SB(sb);
#ifdef CONFIG_QUOTA
+ char *usr_qf_name, *grp_qf_name;
/*
* We do the test below only for project quotas. 'usrquota' and
* 'grpquota' mount options are allowed even without quota feature