Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 04c09388 authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim
Browse files

f2fs: fix incorrect parsing with option string



Previously 'background_gc={on***,off***}' is being parsed as correct option,
with this patch we cloud fix the trivial bug in mount process.

Change log from v1:
 o need to check length of parameter suggested by Jaegeuk Kim.

Signed-off-by: default avatarChao Yu <chao2.yu@samsung.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
parent e4fc5fbf
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -258,9 +258,9 @@ static int parse_options(struct super_block *sb, char *options)


			if (!name)
			if (!name)
				return -ENOMEM;
				return -ENOMEM;
			if (!strncmp(name, "on", 2))
			if (strlen(name) == 2 && !strncmp(name, "on", 2))
				set_opt(sbi, BG_GC);
				set_opt(sbi, BG_GC);
			else if (!strncmp(name, "off", 3))
			else if (strlen(name) == 3 && !strncmp(name, "off", 3))
				clear_opt(sbi, BG_GC);
				clear_opt(sbi, BG_GC);
			else {
			else {
				kfree(name);
				kfree(name);