summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/super.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2016-09-19 17:55:10 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2016-09-30 10:05:46 -0700
commita468f0ef516fda9c7d91bb550d458e853d76955e (patch)
tree87906aa2c4e349c0b04e8276de05cf956887e150 /fs/f2fs/super.c
parent5d4c0af41fd4cc26cb75af4f3de7fb63c91209c1 (diff)
downloadlinux-a468f0ef516fda9c7d91bb550d458e853d76955e.tar.gz
linux-a468f0ef516fda9c7d91bb550d458e853d76955e.tar.bz2
linux-a468f0ef516fda9c7d91bb550d458e853d76955e.zip
f2fs: use crc and cp version to determine roll-forward recovery
Previously, we used cp_version only to detect recoverable dnodes. In order to avoid same garbage cp_version, we needed to truncate the next dnode during checkpoint, resulting in additional discard or data write. If we can distinguish this by using crc in addition to cp_version, we can remove this overhead. There is backward compatibility concern where it changes node_footer layout. So, this patch introduces a new checkpoint flag, CP_CRC_RECOVERY_FLAG, to detect new layout. New layout will be activated only when this flag is set. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/super.c')
-rw-r--r--fs/f2fs/super.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 29e3cf4ccf1b..9649b79eefe8 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -1827,6 +1827,9 @@ try_onemore:
if (need_fsck)
set_sbi_flag(sbi, SBI_NEED_FSCK);
+ if (!retry)
+ goto skip_recovery;
+
err = recover_fsync_data(sbi, false);
if (err < 0) {
need_fsck = true;
@@ -1844,7 +1847,7 @@ try_onemore:
goto free_kobj;
}
}
-
+skip_recovery:
/* recover_fsync_data() cleared this already */
clear_sbi_flag(sbi, SBI_POR_DOING);