aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/checkpoint.c
diff options
context:
space:
mode:
authorWanpeng Li <wanpeng.li@linux.intel.com>2015-02-25 18:57:21 -0500
committerJaegeuk Kim <jaegeuk@kernel.org>2015-04-10 18:08:26 -0400
commit3c64298579a1343cbdf3d2f17adf774a58546aae (patch)
treed63194085ed8b60cd2f657056c427ba7a3cc16eb /fs/f2fs/checkpoint.c
parent551414861fbd494d58d50f4750d1d1b7f42b6df1 (diff)
f2fs: fix the number of orphan inode blocks
cp_pack_start_sum is calculated in do_checkpoint and is equal to cpu_to_le32(1 + cp_payload_blks + orphan_blocks). The number of orphan inode blocks is take advantage of by recover_orphan_inodes to readahead meta pages and recovery inodes. However, current codes forget to reduce the number of cp payload blocks when calculate the number of orphan inode blocks. This patch fix it. Signed-off-by: Wanpeng Li <wanpeng.li@linux.intel.com> Reviewed-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/checkpoint.c')
-rw-r--r--fs/f2fs/checkpoint.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index c7cafd8d522c..4d5e697d82f6 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -464,7 +464,7 @@ static void recover_orphan_inode(struct f2fs_sb_info *sbi, nid_t ino)
464 464
465void recover_orphan_inodes(struct f2fs_sb_info *sbi) 465void recover_orphan_inodes(struct f2fs_sb_info *sbi)
466{ 466{
467 block_t start_blk, orphan_blkaddr, i, j; 467 block_t start_blk, orphan_blocks, i, j;
468 468
469 if (!is_set_ckpt_flags(F2FS_CKPT(sbi), CP_ORPHAN_PRESENT_FLAG)) 469 if (!is_set_ckpt_flags(F2FS_CKPT(sbi), CP_ORPHAN_PRESENT_FLAG))
470 return; 470 return;
@@ -472,11 +472,11 @@ void recover_orphan_inodes(struct f2fs_sb_info *sbi)
472 set_sbi_flag(sbi, SBI_POR_DOING); 472 set_sbi_flag(sbi, SBI_POR_DOING);
473 473
474 start_blk = __start_cp_addr(sbi) + 1 + __cp_payload(sbi); 474 start_blk = __start_cp_addr(sbi) + 1 + __cp_payload(sbi);
475 orphan_blkaddr = __start_sum_addr(sbi) - 1; 475 orphan_blocks = __start_sum_addr(sbi) - 1 - __cp_payload(sbi);
476 476
477 ra_meta_pages(sbi, start_blk, orphan_blkaddr, META_CP); 477 ra_meta_pages(sbi, start_blk, orphan_blocks, META_CP);
478 478
479 for (i = 0; i < orphan_blkaddr; i++) { 479 for (i = 0; i < orphan_blocks; i++) {
480 struct page *page = get_meta_page(sbi, start_blk + i); 480 struct page *page = get_meta_page(sbi, start_blk + i);
481 struct f2fs_orphan_block *orphan_blk; 481 struct f2fs_orphan_block *orphan_blk;
482 482