From: Sheng Yong Subject: Re: [PATCH] f2fs: check total CP pack block count correctly Date: Wed, 1 Aug 2018 18:58:52 +0800 Message-ID: <1024b2d6-c0c1-0e46-b5b1-30ef8088bc82@huawei.com> References: <20180801034622.162122-1-shengyong1@huawei.com> <2486a962-61cd-ebcc-fca9-42fe7d703e67@huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1fkoqX-00027h-RY for linux-f2fs-devel@lists.sourceforge.net; Wed, 01 Aug 2018 10:59:13 +0000 Received: from szxga07-in.huawei.com ([45.249.212.35] helo=huawei.com) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) id 1fkoqV-005JbJ-NI for linux-f2fs-devel@lists.sourceforge.net; Wed, 01 Aug 2018 10:59:13 +0000 In-Reply-To: Content-Language: en-US List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net To: Chao Yu , jaegeuk@kernel.org Cc: miaoxie@huawei.com, tony.zhangxiaobo@huawei.com, linux-f2fs-devel@lists.sourceforge.net On 2018/8/1 18:26, Chao Yu wrote: > On 2018/8/1 15:36, Sheng Yong wrote: >> >> >> On 2018/8/1 14:56, Chao Yu wrote: >>> Hi Sheng, >>> >>> On 2018/8/1 11:46, Sheng Yong wrote: >>>> Fixes: 652d19558a347 ('f2fs: fix to do sanity check with block address in main area') >>>> Reported-by: Zhang Xiaobo >>>> Signed-off-by: Sheng Yong >>> >>> That's my bad, and thanks for the fix. >>> >>> Do you mind merge this into buggy patch, since the patch has not been upstreamed >>> yet. >> >> No, of course not :) >> >> Thanks, >> >>> >>> Thanks, >>> >>>> --- >>>> fs/f2fs/checkpoint.c | 2 +- >>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>> >>>> diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c >>>> index 3587aa53dc90..c32ee10a1384 100644 >>>> --- a/fs/f2fs/checkpoint.c >>>> +++ b/fs/f2fs/checkpoint.c >>>> @@ -809,7 +809,7 @@ static struct page *validate_checkpoint(struct f2fs_sb_info *sbi, >>>> goto invalid_cp1; >>>> >>>> if (le32_to_cpu(cp_block->cp_pack_total_block_count) > >>>> - sbi->log_blocks_per_seg) { >>>> + sbi->blocks_per_seg - 1) { > > actually, cp_pack_total_block_count can be sbi->blocks_per_seg? > Oh, right, it can be sbi->blocks_per_seg :) Thanks > Thanks, > >>>> f2fs_msg(sbi->sb, KERN_WARNING, >>>> "invalid cp_pack_total_block_count:%u", >>>> le32_to_cpu(cp_block->cp_pack_total_block_count)); >>>> >>> >>> >>> . >>> >> >> >> . >> > > > . > ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot