diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2015-01-14 20:41:41 -0500 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2015-02-11 20:04:33 -0500 |
commit | 85dc2f2c6c84e99e9864ef660f79683aaad85f42 (patch) | |
tree | 2e6826d9bc961294e7cbfc08791273aca2beb0b7 /fs/f2fs/super.c | |
parent | 30a5537f9a9e91937aad6a47f55683f7ce0be257 (diff) |
f2fs: do checkpoint when umount flag is not set
If the previous checkpoint was done without CP_UMOUNT flag, it needs to do
checkpoint with CP_UMOUNT for the next fast boot.
Reviewed-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/super.c')
-rw-r--r-- | fs/f2fs/super.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 84f95cd4076a..0d627f2d1828 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c | |||
@@ -447,8 +447,13 @@ static void f2fs_put_super(struct super_block *sb) | |||
447 | f2fs_destroy_stats(sbi); | 447 | f2fs_destroy_stats(sbi); |
448 | stop_gc_thread(sbi); | 448 | stop_gc_thread(sbi); |
449 | 449 | ||
450 | /* We don't need to do checkpoint when it's clean */ | 450 | /* |
451 | if (sbi->s_dirty) { | 451 | * We don't need to do checkpoint when superblock is clean. |
452 | * But, the previous checkpoint was not done by umount, it needs to do | ||
453 | * clean checkpoint again. | ||
454 | */ | ||
455 | if (sbi->s_dirty || | ||
456 | !is_set_ckpt_flags(F2FS_CKPT(sbi), CP_UMOUNT_FLAG)) { | ||
452 | struct cp_control cpc = { | 457 | struct cp_control cpc = { |
453 | .reason = CP_UMOUNT, | 458 | .reason = CP_UMOUNT, |
454 | }; | 459 | }; |