Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752163AbeADF46 (ORCPT + 1 other); Thu, 4 Jan 2018 00:56:58 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:43132 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751054AbeADF45 (ORCPT ); Thu, 4 Jan 2018 00:56:57 -0500 Subject: Re: [PATCH v2] f2fs: check segment type in __f2fs_replace_block To: Yunlong Song , , , CC: , , , , , , References: <1514619768-134531-1-git-send-email-yunlong.song@huawei.com> <1515037705-23984-1-git-send-email-yunlong.song@huawei.com> From: Chao Yu Message-ID: <8f04c997-cfed-1ee2-9b10-37955ce15f9e@huawei.com> Date: Thu, 4 Jan 2018 13:56:33 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <1515037705-23984-1-git-send-email-yunlong.song@huawei.com> Content-Type: text/plain; charset="windows-1252" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.134.22.195] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Please add simple description here to explain why we need to add this, even though this change is very simple. On 2018/1/4 11:48, Yunlong Song wrote: > Signed-off-by: Yunlong Song > --- > fs/f2fs/segment.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c > index 890d483..e3bbabf 100644 > --- a/fs/f2fs/segment.c > +++ b/fs/f2fs/segment.c > @@ -2719,6 +2719,8 @@ void __f2fs_replace_block(struct f2fs_sb_info *sbi, struct f2fs_summary *sum, > se = get_seg_entry(sbi, segno); > type = se->type; > > + f2fs_bug_on(sbi, se->valid_blocks && IS_NODESEG(type)); > + > down_write(&SM_I(sbi)->curseg_lock); > > if (!recover_curseg) { >