[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240229163011.16248-2-lhenriques@suse.de>
Date: Thu, 29 Feb 2024 16:30:08 +0000
From: Luis Henriques <lhenriques@...e.de>
To: Theodore Ts'o <tytso@....edu>,
Andreas Dilger <adilger.kernel@...ger.ca>,
Alexander Viro <viro@...iv.linux.org.uk>,
Christian Brauner <brauner@...nel.org>,
Jan Kara <jack@...e.cz>,
Miklos Szeredi <miklos@...redi.hu>,
Amir Goldstein <amir73il@...il.com>
Cc: linux-ext4@...r.kernel.org,
linux-fsdevel@...r.kernel.org,
linux-unionfs@...r.kernel.org,
linux-kernel@...r.kernel.org,
Luis Henriques <lhenriques@...e.de>
Subject: [PATCH 1/3] fs_parser: handle parameters that can be empty and don't have a value
Currently, only parameters that have the fs_parameter_spec 'type' set to
NULL are handled as 'flag' types. However, parameters that have the
'fs_param_can_be_empty' flag set and their value is NULL should also be
handled as 'flag' type, as their type is set to 'fs_value_is_flag'.
Signed-off-by: Luis Henriques <lhenriques@...e.de>
---
fs/fs_parser.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/fs_parser.c b/fs/fs_parser.c
index edb3712dcfa5..53f6cb98a3e0 100644
--- a/fs/fs_parser.c
+++ b/fs/fs_parser.c
@@ -119,7 +119,8 @@ int __fs_parse(struct p_log *log,
/* Try to turn the type we were given into the type desired by the
* parameter and give an error if we can't.
*/
- if (is_flag(p)) {
+ if (is_flag(p) ||
+ (!param->string && (p->flags & fs_param_can_be_empty))) {
if (param->type != fs_value_is_flag)
return inval_plog(log, "Unexpected value for '%s'",
param->key);
Powered by blists - more mailing lists