mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-06 08:46:46 +00:00
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>
This commit is contained in:
parent
e5a185c26c
commit
4c94bff967
1 changed files with 9 additions and 2 deletions
|
@ -88,6 +88,7 @@ static void ext4_unregister_li_request(struct super_block *sb);
|
||||||
static void ext4_clear_request_list(void);
|
static void ext4_clear_request_list(void);
|
||||||
static struct inode *ext4_get_journal_inode(struct super_block *sb,
|
static struct inode *ext4_get_journal_inode(struct super_block *sb,
|
||||||
unsigned int journal_inum);
|
unsigned int journal_inum);
|
||||||
|
static int ext4_validate_options(struct super_block *sb);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Lock ordering
|
* Lock ordering
|
||||||
|
@ -2582,10 +2583,9 @@ static int parse_options(char *options, struct super_block *sb,
|
||||||
struct ext4_parsed_options *ret_opts,
|
struct ext4_parsed_options *ret_opts,
|
||||||
int is_remount)
|
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];
|
substring_t args[MAX_OPT_ARGS];
|
||||||
int token;
|
int token;
|
||||||
|
char *p;
|
||||||
|
|
||||||
if (!options)
|
if (!options)
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -2603,7 +2603,14 @@ static int parse_options(char *options, struct super_block *sb,
|
||||||
is_remount) < 0)
|
is_remount) < 0)
|
||||||
return 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
|
#ifdef CONFIG_QUOTA
|
||||||
|
char *usr_qf_name, *grp_qf_name;
|
||||||
/*
|
/*
|
||||||
* We do the test below only for project quotas. 'usrquota' and
|
* We do the test below only for project quotas. 'usrquota' and
|
||||||
* 'grpquota' mount options are allowed even without quota feature
|
* 'grpquota' mount options are allowed even without quota feature
|
||||||
|
|
Loading…
Reference in a new issue