Commit 277afbde authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim
Browse files

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: 4354994f ("f2fs: checkpoint disabling")
Signed-off-by: default avatarChao Yu <chao@kernel.org>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 2e650912
Loading
Loading
Loading
Loading
+2 −5
Original line number Original line Diff line number Diff line
@@ -2062,11 +2062,10 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data)
	bool need_restart_ckpt = false, need_stop_ckpt = false;
	bool need_restart_ckpt = false, need_stop_ckpt = false;
	bool need_restart_flush = false, need_stop_flush = false;
	bool need_restart_flush = false, need_stop_flush = false;
	bool no_extent_cache = !test_opt(sbi, EXTENT_CACHE);
	bool no_extent_cache = !test_opt(sbi, EXTENT_CACHE);
	bool disable_checkpoint = test_opt(sbi, DISABLE_CHECKPOINT);
	bool enable_checkpoint = !test_opt(sbi, DISABLE_CHECKPOINT);
	bool no_io_align = !F2FS_IO_ALIGNED(sbi);
	bool no_io_align = !F2FS_IO_ALIGNED(sbi);
	bool no_atgc = !test_opt(sbi, ATGC);
	bool no_atgc = !test_opt(sbi, ATGC);
	bool no_compress_cache = !test_opt(sbi, COMPRESS_CACHE);
	bool no_compress_cache = !test_opt(sbi, COMPRESS_CACHE);
	bool checkpoint_changed;
#ifdef CONFIG_QUOTA
#ifdef CONFIG_QUOTA
	int i, j;
	int i, j;
#endif
#endif
@@ -2111,8 +2110,6 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data)
	err = parse_options(sb, data, true);
	err = parse_options(sb, data, true);
	if (err)
	if (err)
		goto restore_opts;
		goto restore_opts;
	checkpoint_changed =
			disable_checkpoint != test_opt(sbi, DISABLE_CHECKPOINT);


	/*
	/*
	 * Previous and new state of filesystem is RO,
	 * Previous and new state of filesystem is RO,
@@ -2234,7 +2231,7 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data)
		need_stop_flush = true;
		need_stop_flush = true;
	}
	}


	if (checkpoint_changed) {
	if (enable_checkpoint == !!test_opt(sbi, DISABLE_CHECKPOINT)) {
		if (test_opt(sbi, DISABLE_CHECKPOINT)) {
		if (test_opt(sbi, DISABLE_CHECKPOINT)) {
			err = f2fs_disable_checkpoint(sbi);
			err = f2fs_disable_checkpoint(sbi);
			if (err)
			if (err)