Skip to contentSkip to conversation

dm-thin: fix parsing of feature arguments

PATCH In review Mikulas Patocka 2 participants 2 messages Nov 6 – Nov 11 Device mapper

lore
Share & tools
lore

Mikulas Patocka

author maintainer
#0 lore raw

PATCH 1/1 dm-thin: fix parsing of feature arguments

"struct dm_arg _args" limits the number of arguments to 4, but there are 5 possible arguments that can be specified.

Assisted-by Claude:claude-opus-5
Fixes 787a996cb251 ("dm thin: add error_if_no_space feature")
---
 drivers/md/dm-thin.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/dm-thin.c +1 -1
Index: linux-2.6/drivers/md/dm-thin.c
===================================================================
@@ -3147,7 +3147,7 @@ static int parse_pool_features(struct dm
 	const char *arg_name;
 
 	static const struct dm_arg _args[] = {
-		{0, 4, "Invalid number of pool feature arguments"},
+		{0, 5, "Invalid number of pool feature arguments"},
 	};
 
 	/*
#1 lore raw
Quoted 20 lines · Mikulas Patocka

"struct dm_arg _args" limits the number of arguments to 4, but there are 5 possible arguments that can be specified.

Assisted-by Claude:claude-opus-5
Fixes 787a996cb251 ("dm thin: add error_if_no_space feature")
---
 drivers/md/dm-thin.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/drivers/md/dm-thin.c
===================================================================

drivers/md/dm-thin.c static int parse_pool_features(struct dm · line 3153

Quoted 8 lines
drivers/md/dm-thin.c +1 -1
@@ -3147,7 +3147,7 @@ static int parse_pool_features(struct dm
        const char *arg_name;
 
        static const struct dm_arg _args[] = {
-               {0, 4, "Invalid number of pool feature arguments"},
+               {0, 5, "Invalid number of pool feature arguments"},
        };
 
        /*

The ignore_discard and no_discard_passdown arguments are mutually exclusive, so setting a thin-pool table with all 5 arguments is redundant. Thus, dm-thin rejects tables with more than 4 feature arguments.

Hank