From: Chao Yu Date: Thu, 18 Nov 2021 06:35:20 +0000 (+0900) Subject: f2fs: fix wrong checkpoint_changed value in f2fs_remount() X-Git-Tag: submit/tizen/20211117.113146^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Faccepted%2Ftizen_6.5_unified;p=platform%2Fkernel%2Flinux-amlogic.git f2fs: fix wrong checkpoint_changed value in f2fs_remount() In f2fs_remount(), return value of test_opt() is an unsigned int type variable, however when we compare it to a bool type variable, it cause wrong result, fix it. Fixes: 4354994f097d ("f2fs: checkpoint disabling") Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim [dwoo08.lee: backport from mainline commit 277afbde6ca2] Signed-off-by: Dongwoo Lee Change-Id: Icd4dfff441bf84f605d8d09de7be89da88548654 --- diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index dacb3bc8330f..071d6027c156 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -1487,8 +1487,7 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data) bool need_restart_gc = false; bool need_stop_gc = false; bool no_extent_cache = !test_opt(sbi, EXTENT_CACHE); - bool disable_checkpoint = test_opt(sbi, DISABLE_CHECKPOINT); - bool checkpoint_changed; + bool enable_checkpoint = !test_opt(sbi, DISABLE_CHECKPOINT); #ifdef CONFIG_QUOTA int i, j; #endif @@ -1533,8 +1532,7 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data) err = parse_options(sb, data); if (err) goto restore_opts; - checkpoint_changed = - disable_checkpoint != test_opt(sbi, DISABLE_CHECKPOINT); + /* * Previous and new state of filesystem is RO, @@ -1603,7 +1601,7 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data) clear_sbi_flag(sbi, SBI_IS_CLOSE); } - if (checkpoint_changed) { + if (enable_checkpoint == !!test_opt(sbi, DISABLE_CHECKPOINT)) { if (test_opt(sbi, DISABLE_CHECKPOINT)) { err = f2fs_disable_checkpoint(sbi); if (err)