From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wanpeng Li Subject: Re: [PATCH] f2fs: fix recover orphan inodes Date: Thu, 26 Feb 2015 07:04:07 +0800 Message-ID: <20150225230407.GA7267@kernel> References: <1424840017-97604-1-git-send-email-wanpeng.li@linux.intel.com> <20150225183403.GA51593@jaegeuk-mac02.mot.com> Reply-To: Wanpeng Li Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YQlHq-0006sr-0y for linux-f2fs-devel@lists.sourceforge.net; Wed, 25 Feb 2015 23:22:38 +0000 Received: from mga14.intel.com ([192.55.52.115]) by sog-mx-4.v43.ch3.sourceforge.com with esmtp (Exim 4.76) id 1YQlHo-00012H-AR for linux-f2fs-devel@lists.sourceforge.net; Wed, 25 Feb 2015 23:22:37 +0000 Content-Disposition: inline In-Reply-To: <20150225183403.GA51593@jaegeuk-mac02.mot.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net To: Jaegeuk Kim Cc: Wanpeng Li , linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Hi Jaegeuk, On Wed, Feb 25, 2015 at 10:35:23AM -0800, Jaegeuk Kim wrote: >Hi Wanpeng, > >On Wed, Feb 25, 2015 at 12:53:37PM +0800, Wanpeng Li wrote: >> recover_orphan_inodes is used to recover orphan inodes, the meta pages >> which readahead should be orphan_blkaddr - start_blk instead of orphan_blkaddr. >> This patch fix it. >> >> Signed-off-by: Wanpeng Li >> --- >> fs/f2fs/checkpoint.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c >> index e6c271f..0f42ff3 100644 >> --- a/fs/f2fs/checkpoint.c >> +++ b/fs/f2fs/checkpoint.c >> @@ -468,9 +468,9 @@ void recover_orphan_inodes(struct f2fs_sb_info *sbi) >> le32_to_cpu(F2FS_RAW_SUPER(sbi)->cp_payload); > >Actually it seems the name, orphan_blkaddr, was wrong. >That should be orphan_blocks which is no need to fix like this. > >Instead, I found there is another bug below. > >> orphan_blkaddr = __start_sum_addr(sbi) - 1; > orphan_blocks = __start_sum_addr(sbi) - 1 - > le32_to_cpu(F2FS_RAW_SUPER(sbi)->cp_payload); Indeed, I will send a patch to fix it. > >It may help to define a macro to get cp_payload. > Will do. Thanks for your help. ;-) Regards, Wanpeng Li >> >> - ra_meta_pages(sbi, start_blk, orphan_blkaddr, META_CP); >> + ra_meta_pages(sbi, start_blk, orphan_blkaddr - start_blk, META_CP); > >The orphan_blocks is enough. No need to fix this. > >> >> - for (i = 0; i < orphan_blkaddr; i++) { >> + for (i = 0; i < orphan_blkaddr - start_blk; i++) { > >ditto. > >Thanks, ------------------------------------------------------------------------------ Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753447AbbBYXWj (ORCPT ); Wed, 25 Feb 2015 18:22:39 -0500 Received: from mga03.intel.com ([134.134.136.65]:32968 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753156AbbBYXWh (ORCPT ); Wed, 25 Feb 2015 18:22:37 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,648,1418112000"; d="scan'208";a="532915205" Date: Thu, 26 Feb 2015 07:04:07 +0800 From: Wanpeng Li To: Jaegeuk Kim Cc: Changman Lee , linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Wanpeng Li Subject: Re: [PATCH] f2fs: fix recover orphan inodes Message-ID: <20150225230407.GA7267@kernel> Reply-To: Wanpeng Li References: <1424840017-97604-1-git-send-email-wanpeng.li@linux.intel.com> <20150225183403.GA51593@jaegeuk-mac02.mot.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150225183403.GA51593@jaegeuk-mac02.mot.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jaegeuk, On Wed, Feb 25, 2015 at 10:35:23AM -0800, Jaegeuk Kim wrote: >Hi Wanpeng, > >On Wed, Feb 25, 2015 at 12:53:37PM +0800, Wanpeng Li wrote: >> recover_orphan_inodes is used to recover orphan inodes, the meta pages >> which readahead should be orphan_blkaddr - start_blk instead of orphan_blkaddr. >> This patch fix it. >> >> Signed-off-by: Wanpeng Li >> --- >> fs/f2fs/checkpoint.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c >> index e6c271f..0f42ff3 100644 >> --- a/fs/f2fs/checkpoint.c >> +++ b/fs/f2fs/checkpoint.c >> @@ -468,9 +468,9 @@ void recover_orphan_inodes(struct f2fs_sb_info *sbi) >> le32_to_cpu(F2FS_RAW_SUPER(sbi)->cp_payload); > >Actually it seems the name, orphan_blkaddr, was wrong. >That should be orphan_blocks which is no need to fix like this. > >Instead, I found there is another bug below. > >> orphan_blkaddr = __start_sum_addr(sbi) - 1; > orphan_blocks = __start_sum_addr(sbi) - 1 - > le32_to_cpu(F2FS_RAW_SUPER(sbi)->cp_payload); Indeed, I will send a patch to fix it. > >It may help to define a macro to get cp_payload. > Will do. Thanks for your help. ;-) Regards, Wanpeng Li >> >> - ra_meta_pages(sbi, start_blk, orphan_blkaddr, META_CP); >> + ra_meta_pages(sbi, start_blk, orphan_blkaddr - start_blk, META_CP); > >The orphan_blocks is enough. No need to fix this. > >> >> - for (i = 0; i < orphan_blkaddr; i++) { >> + for (i = 0; i < orphan_blkaddr - start_blk; i++) { > >ditto. > >Thanks,