Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751241AbdHEBYp (ORCPT ); Fri, 4 Aug 2017 21:24:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:41584 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750945AbdHEBYn (ORCPT ); Fri, 4 Aug 2017 21:24:43 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9D2EB22C94 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=chao@kernel.org Subject: Re: [f2fs-dev] [PATCH] f2fs: do not change the valid_block value if cur_valid_map was wrongly set or cleared To: Yunlong Song , jaegeuk@kernel.org, yuchao0@huawei.com, yunlong.song@icloud.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net References: <1501680013-48861-1-git-send-email-yunlong.song@huawei.com> <1501683414-54834-1-git-send-email-yunlong.song@huawei.com> From: Chao Yu Message-ID: <421ee9e7-89af-d414-9b12-7bc47dc7bc69@kernel.org> Date: Sat, 5 Aug 2017 09:23:48 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <1501683414-54834-1-git-send-email-yunlong.song@huawei.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 961 Lines: 32 On 2017/8/2 22:16, Yunlong Song wrote: > Signed-off-by: Yunlong Song Reviewed-by: Chao Yu > --- > fs/f2fs/segment.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c > index 40e40c5..9e3249a 100644 > --- a/fs/f2fs/segment.c > +++ b/fs/f2fs/segment.c > @@ -1540,6 +1540,8 @@ static void update_sit_entry(struct f2fs_sb_info *sbi, block_t blkaddr, int del) > f2fs_msg(sbi->sb, KERN_ERR, > "Bitmap was wrongly set, blk:%u", blkaddr); > f2fs_bug_on(sbi, 1); > + se->valid_blocks--; > + del = 0; > } > > if (f2fs_discard_en(sbi) && > @@ -1567,6 +1569,8 @@ static void update_sit_entry(struct f2fs_sb_info *sbi, block_t blkaddr, int del) > f2fs_msg(sbi->sb, KERN_ERR, > "Bitmap was wrongly cleared, blk:%u", blkaddr); > f2fs_bug_on(sbi, 1); > + se->valid_blocks++; > + del = 0; > } > > if (f2fs_discard_en(sbi) && >