All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukas Czerner <lczerner@redhat.com>
To: linux-ext4@vger.kernel.org, tytso@mit.edu
Cc: linux-fsdevel@vger.kernel.org, Carlos Maiolino <cmaiolino@redhat.com>
Subject: [PATCH v4 03/13] ext4: move option validation to a separate function
Date: Wed, 27 Oct 2021 16:18:47 +0200	[thread overview]
Message-ID: <20211027141857.33657-4-lczerner@redhat.com> (raw)
In-Reply-To: <20211027141857.33657-1-lczerner@redhat.com>

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>
---
 fs/ext4/super.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 42f4a3741692..5f6ad0615a2a 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -87,6 +87,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
@@ -2575,10 +2576,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;
@@ -2596,7 +2596,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
-- 
2.31.1


  parent reply	other threads:[~2021-10-27 14:19 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-27 14:18 [PATCH v4 00/13] ext4: new mount API conversion Lukas Czerner
2021-10-27 14:18 ` [PATCH v4 01/13] fs_parse: allow parameter value to be empty Lukas Czerner
2021-10-29  8:44   ` Christian Brauner
2021-11-01  9:25     ` Lukas Czerner
2021-10-27 14:18 ` [PATCH v4 02/13] ext4: Add fs parameter specifications for mount options Lukas Czerner
2021-10-27 14:18 ` Lukas Czerner [this message]
2021-10-27 14:18 ` [PATCH v4 04/13] ext4: Change handle_mount_opt() to use fs_parameter Lukas Czerner
2021-10-27 14:18 ` [PATCH v4 05/13] ext4: Allow sb to be NULL in ext4_msg() Lukas Czerner
2021-10-27 14:18 ` [PATCH v4 06/13] ext4: move quota configuration out of handle_mount_opt() Lukas Czerner
2021-10-27 14:18 ` [PATCH v4 07/13] ext4: check ext2/3 compatibility outside handle_mount_opt() Lukas Czerner
2021-10-27 14:18 ` [PATCH v4 08/13] ext4: get rid of super block and sbi from handle_mount_ops() Lukas Czerner
2021-10-27 14:18 ` [PATCH v4 09/13] ext4: Completely separate options parsing and sb setup Lukas Czerner
2021-10-27 14:18 ` [PATCH v4 10/13] ext4: clean up return values in handle_mount_opt() Lukas Czerner
2021-10-27 14:18 ` [PATCH v4 11/13] ext4: change token2str() to use ext4_param_specs Lukas Czerner
2021-10-27 14:18 ` [PATCH v4 12/13] ext4: switch to the new mount api Lukas Czerner
2021-10-27 14:18 ` [PATCH v4 13/13] ext4: Remove unused match_table_t tokens Lukas Czerner
2021-10-27 21:39 ` [PATCH v4 00/13] ext4: new mount API conversion Sedat Dilek
2021-10-28 13:49   ` Lukas Czerner
2021-12-09 19:17 ` Theodore Y. Ts'o
2021-12-09 19:55   ` Lukas Czerner
2021-12-09 22:09     ` Theodore Y. Ts'o
2021-12-09 22:22 ` Theodore Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211027141857.33657-4-lczerner@redhat.com \
    --to=lczerner@redhat.com \
    --cc=cmaiolino@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.