From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 714E7ECDFB8 for ; Mon, 23 Jul 2018 14:10:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3550520856 for ; Mon, 23 Jul 2018 14:10:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3550520856 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388347AbeGWPMS (ORCPT ); Mon, 23 Jul 2018 11:12:18 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:55384 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388282AbeGWPMR (ORCPT ); Mon, 23 Jul 2018 11:12:17 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id E113C64FD628F; Mon, 23 Jul 2018 22:10:45 +0800 (CST) Received: from huawei.com (10.113.189.234) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.382.0; Mon, 23 Jul 2018 22:10:36 +0800 From: Yunlong Song To: , , , , CC: , , , , , Subject: [PATCH 3/5] f2fs: clear_bit the SSR selected section in the victim_secmap Date: Mon, 23 Jul 2018 22:10:20 +0800 Message-ID: <1532355022-163029-4-git-send-email-yunlong.song@huawei.com> X-Mailer: git-send-email 1.8.5.2 In-Reply-To: <1532355022-163029-1-git-send-email-yunlong.song@huawei.com> References: <1532355022-163029-1-git-send-email-yunlong.song@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.113.189.234] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org SSR uses get_victim to select ssr segment to allocate data blocks, which makes the previous result of victim_secmap inaccurately, so we would better clear the bit of the section in the victim_secmap. Signed-off-by: Yunlong Song --- fs/f2fs/gc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index 705d419..0e7a265 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -394,7 +394,8 @@ static int get_victim_by_default(struct f2fs_sb_info *sbi, set_bit(secno, dirty_i->victim_secmap); sbi->cur_bg_victim_sec = secno; } - } + } else + clear_bit(secno, dirty_i->victim_secmap); *result = (p.min_segno / p.ofs_unit) * p.ofs_unit; trace_f2fs_get_victim(sbi->sb, type, gc_type, &p, -- 1.8.5.2