f2fs: guarantee to write dirty data when enabling checkpoint back
authorJaegeuk Kim <jaegeuk@kernel.org>
Thu, 19 Aug 2021 21:00:57 +0000 (14:00 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Sep 2021 07:50:46 +0000 (09:50 +0200)
commit611b7f9dc9f696ba0f9ab03b5c6500f3718cbebe
treefe04edbdb3c38b4c00a6b1288f0abea29b68746a
parent75ffcd85dff52e3e94a62587d339bc2fb81aba07
f2fs: guarantee to write dirty data when enabling checkpoint back

commit dddd3d65293a52c2c3850c19b1e5115712e534d8 upstream.

We must flush all the dirty data when enabling checkpoint back. Let's guarantee
that first by adding a retry logic on sync_inodes_sb(). In addition to that,
this patch adds to flush data in fsync when checkpoint is disabled, which can
mitigate the sync_inodes_sb() failures in advance.

Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/f2fs/file.c
fs/f2fs/super.c