diff options
author | Chao Yu <chao2.yu@samsung.com> | 2014-03-17 21:07:59 -0400 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2014-03-17 21:13:02 -0400 |
commit | 04c0938844695ab97b79a477a9f57748fe97d2f5 (patch) | |
tree | 7cd1fb81cbbcc0d82984cb393634b1f404dfe6e6 /fs/f2fs | |
parent | e4fc5fbfc9e285356be7e5208bb1a2fa377b2656 (diff) |
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: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs')
-rw-r--r-- | fs/f2fs/super.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 057a3efb2487..dbe402b1a4b7 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c | |||
@@ -258,9 +258,9 @@ static int parse_options(struct super_block *sb, char *options) | |||
258 | 258 | ||
259 | if (!name) | 259 | if (!name) |
260 | return -ENOMEM; | 260 | return -ENOMEM; |
261 | if (!strncmp(name, "on", 2)) | 261 | if (strlen(name) == 2 && !strncmp(name, "on", 2)) |
262 | set_opt(sbi, BG_GC); | 262 | set_opt(sbi, BG_GC); |
263 | else if (!strncmp(name, "off", 3)) | 263 | else if (strlen(name) == 3 && !strncmp(name, "off", 3)) |
264 | clear_opt(sbi, BG_GC); | 264 | clear_opt(sbi, BG_GC); |
265 | else { | 265 | else { |
266 | kfree(name); | 266 | kfree(name); |