[3/3] overlay: fix mount parameters check for empty values

Message ID 20240229163011.16248-4-lhenriques@suse.de
State New
Headers
Series fs_parser: handle parameters that can be empty and don't have a value |

Commit Message

Luis Henriques Feb. 29, 2024, 4:30 p.m. UTC
  Now that parameters that have the flag 'fs_param_can_be_empty' set and
their value is NULL are handled as 'flag' type, we need to properly check
for empty (NULL) values.

Signed-off-by: Luis Henriques <lhenriques@suse.de>
---
 fs/overlayfs/params.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Christian Brauner March 1, 2024, 1:37 p.m. UTC | #1
On Thu, Feb 29, 2024 at 04:30:10PM +0000, Luis Henriques wrote:
> Now that parameters that have the flag 'fs_param_can_be_empty' set and
> their value is NULL are handled as 'flag' type, we need to properly check
> for empty (NULL) values.
> 
> Signed-off-by: Luis Henriques <lhenriques@suse.de>
> ---
>  fs/overlayfs/params.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/overlayfs/params.c b/fs/overlayfs/params.c
> index 112b4b12f825..09428af6abc5 100644
> --- a/fs/overlayfs/params.c
> +++ b/fs/overlayfs/params.c
> @@ -441,7 +441,7 @@ static int ovl_parse_param_lowerdir(const char *name, struct fs_context *fc)
>  	/* drop all existing lower layers */
>  	ovl_reset_lowerdirs(ctx);
>  
> -	if (!*name)
> +	if (!name)

Same comment/qestion as on ext4 patch.
  

Patch

diff --git a/fs/overlayfs/params.c b/fs/overlayfs/params.c
index 112b4b12f825..09428af6abc5 100644
--- a/fs/overlayfs/params.c
+++ b/fs/overlayfs/params.c
@@ -441,7 +441,7 @@  static int ovl_parse_param_lowerdir(const char *name, struct fs_context *fc)
 	/* drop all existing lower layers */
 	ovl_reset_lowerdirs(ctx);
 
-	if (!*name)
+	if (!name)
 		return 0;
 
 	if (*name == ':') {