Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753878AbbBYX57 (ORCPT ); Wed, 25 Feb 2015 18:57:59 -0500 Received: from mga09.intel.com ([134.134.136.24]:36105 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752989AbbBYX56 (ORCPT ); Wed, 25 Feb 2015 18:57:58 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,648,1418112000"; d="scan'208";a="671726679" From: Wanpeng Li To: Jaegeuk Kim Cc: Changman Lee , linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Wanpeng Li Subject: [PATCH 2/2] f2fs: fix the number of orphan inode blocks Date: Thu, 26 Feb 2015 07:57:21 +0800 Message-Id: <1424908641-76409-2-git-send-email-wanpeng.li@linux.intel.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1424908641-76409-1-git-send-email-wanpeng.li@linux.intel.com> References: <1424908641-76409-1-git-send-email-wanpeng.li@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1826 Lines: 48 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 --- fs/f2fs/checkpoint.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index 4dbcc81..db82e09 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) void recover_orphan_inodes(struct f2fs_sb_info *sbi) { - block_t start_blk, orphan_blkaddr, i, j; + block_t start_blk, orphan_blocks, i, j; if (!is_set_ckpt_flags(F2FS_CKPT(sbi), CP_ORPHAN_PRESENT_FLAG)) return; @@ -472,11 +472,11 @@ void recover_orphan_inodes(struct f2fs_sb_info *sbi) set_sbi_flag(sbi, SBI_POR_DOING); start_blk = __start_cp_addr(sbi) + 1 + __cp_payload(sbi); - orphan_blkaddr = __start_sum_addr(sbi) - 1; + orphan_blocks = __start_sum_addr(sbi) - 1 - __cp_payload(sbi); - ra_meta_pages(sbi, start_blk, orphan_blkaddr, META_CP); + ra_meta_pages(sbi, start_blk, orphan_blocks, META_CP); - for (i = 0; i < orphan_blkaddr; i++) { + for (i = 0; i < orphan_blocks; i++) { struct page *page = get_meta_page(sbi, start_blk + i); struct f2fs_orphan_block *orphan_blk; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/