We don't guarantee cp_addr is fixed by cp_ver due to sload.

Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org>
---
 fsck/f2fs.h | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/fsck/f2fs.h b/fsck/f2fs.h
index 39ff161..fbb878a 100644
--- a/fsck/f2fs.h
+++ b/fsck/f2fs.h
@@ -280,19 +280,10 @@ static inline bool is_set_ckpt_flags(struct 
f2fs_checkpoint *cp, unsigned int f)
 
 static inline block_t __start_cp_addr(struct f2fs_sb_info *sbi)
 {
-       block_t start_addr;
-       struct f2fs_checkpoint *ckpt = F2FS_CKPT(sbi);
-       unsigned long long ckpt_version = le64_to_cpu(ckpt->checkpoint_ver);
-
-       start_addr = le32_to_cpu(F2FS_RAW_SUPER(sbi)->cp_blkaddr);
+       block_t start_addr = le32_to_cpu(F2FS_RAW_SUPER(sbi)->cp_blkaddr);
 
-       /*
-        * odd numbered checkpoint should at cp segment 0
-        * and even segent must be at cp segment 1
-        */
-       if (!(ckpt_version & 1))
+       if (sbi->cur_cp == 2)
                start_addr += sbi->blocks_per_seg;
-
        return start_addr;
 }
 
-- 
2.8.3


------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to