aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/recovery.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/f2fs/recovery.c')
-rw-r--r--fs/f2fs/recovery.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c
index 7ca7aadaa607..d36ef35353b2 100644
--- a/fs/f2fs/recovery.c
+++ b/fs/f2fs/recovery.c
@@ -459,6 +459,9 @@ int recover_fsync_data(struct f2fs_sb_info *sbi)
459 /* step #1: find fsynced inode numbers */ 459 /* step #1: find fsynced inode numbers */
460 sbi->por_doing = true; 460 sbi->por_doing = true;
461 461
462 /* prevent checkpoint */
463 mutex_lock(&sbi->cp_mutex);
464
462 blkaddr = NEXT_FREE_BLKADDR(sbi, curseg); 465 blkaddr = NEXT_FREE_BLKADDR(sbi, curseg);
463 466
464 err = find_fsync_dnodes(sbi, &inode_list); 467 err = find_fsync_dnodes(sbi, &inode_list);
@@ -490,8 +493,13 @@ out:
490 /* Flush all the NAT/SIT pages */ 493 /* Flush all the NAT/SIT pages */
491 while (get_pages(sbi, F2FS_DIRTY_META)) 494 while (get_pages(sbi, F2FS_DIRTY_META))
492 sync_meta_pages(sbi, META, LONG_MAX); 495 sync_meta_pages(sbi, META, LONG_MAX);
496 set_ckpt_flags(sbi->ckpt, CP_ERROR_FLAG);
497 mutex_unlock(&sbi->cp_mutex);
493 } else if (need_writecp) { 498 } else if (need_writecp) {
499 mutex_unlock(&sbi->cp_mutex);
494 write_checkpoint(sbi, false); 500 write_checkpoint(sbi, false);
501 } else {
502 mutex_unlock(&sbi->cp_mutex);
495 } 503 }
496 return err; 504 return err;
497} 505}