diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2014-08-13 16:30:46 -0700 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2014-08-21 13:57:00 -0700 |
commit | 14f4e690857715d5e0cbe403b4cb8e8c904a6c15 (patch) | |
tree | 9287671809e17cc767e92679102e3b1c86031c21 /fs | |
parent | b3fe0a0da2cb18d3c94d5ddce836e7f889d7286b (diff) | |
download | linux-stable-14f4e690857715d5e0cbe403b4cb8e8c904a6c15.tar.gz linux-stable-14f4e690857715d5e0cbe403b4cb8e8c904a6c15.tar.bz2 linux-stable-14f4e690857715d5e0cbe403b4cb8e8c904a6c15.zip |
f2fs: prevent checkpoint during roll-forward
Any checkpoint should not be done during the core roll-forward procedure.
Especially, it includes error cases too.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/f2fs/recovery.c | 8 |
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) /* step #1: find fsynced inode numbers */ sbi->por_doing = true; + /* prevent checkpoint */ + mutex_lock(&sbi->cp_mutex); + blkaddr = NEXT_FREE_BLKADDR(sbi, curseg); err = find_fsync_dnodes(sbi, &inode_list); @@ -490,8 +493,13 @@ out: /* Flush all the NAT/SIT pages */ while (get_pages(sbi, F2FS_DIRTY_META)) sync_meta_pages(sbi, META, LONG_MAX); + set_ckpt_flags(sbi->ckpt, CP_ERROR_FLAG); + mutex_unlock(&sbi->cp_mutex); } else if (need_writecp) { + mutex_unlock(&sbi->cp_mutex); write_checkpoint(sbi, false); + } else { + mutex_unlock(&sbi->cp_mutex); } return err; } |