f2fs: flush data when enabling checkpoint back 61/266761/1
authorJaegeuk Kim <jaegeuk@kernel.org>
Wed, 17 Nov 2021 12:20:52 +0000 (21:20 +0900)
committerDongwoo Lee <dwoo08.lee@samsung.com>
Thu, 18 Nov 2021 08:47:10 +0000 (17:47 +0900)
commit807584df1d5f372074d914624d94c2c69c3de362
tree05c4096b22896e2f0e5454b62824810e9247ca22
parent2cd1341e9c8c4fa02a1463ff1bc8e8be23ade4d3
f2fs: flush data when enabling checkpoint back

During checkpoint=disable period, f2fs bypasses all the synchronous IOs such as
sync and fsync. So, when enabling it back, we must flush all of them in order
to keep the data persistent. Otherwise, suddern power-cut right after enabling
checkpoint will cause data loss.

Fixes: 4354994 ("f2fs: checkpoint disabling")
Cc: stable@vger.kernel.org
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
[dwoo08.lee: backport from mainline commit b0ff4fe746fd]
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Change-Id: Ic0810d99c5a3938e191461bd66e7862a4a68e12b
fs/f2fs/super.c