Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751839AbeADDsy (ORCPT + 1 other); Wed, 3 Jan 2018 22:48:54 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:3672 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751737AbeADDsx (ORCPT ); Wed, 3 Jan 2018 22:48:53 -0500 From: Yunlong Song To: , , , , CC: , , , , , , Subject: [PATCH v2] f2fs: check segment type in __f2fs_replace_block Date: Thu, 4 Jan 2018 11:48:25 +0800 Message-ID: <1515037705-23984-1-git-send-email-yunlong.song@huawei.com> X-Mailer: git-send-email 1.8.5.2 In-Reply-To: <1514619768-134531-1-git-send-email-yunlong.song@huawei.com> References: <1514619768-134531-1-git-send-email-yunlong.song@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.107.193.250] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 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) { -- 1.8.5.2