Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5852849imm; Mon, 23 Jul 2018 07:12:02 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfuffPhAyLyOMRnI23dhizII6TiAv4uOXbVkAg9Vhg+Z3JYjb73oin1DzbX2OMJ8C/0gylr X-Received: by 2002:a17:902:3f81:: with SMTP id a1-v6mr13122899pld.29.1532355122550; Mon, 23 Jul 2018 07:12:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532355122; cv=none; d=google.com; s=arc-20160816; b=VMZS/FKCCx2yBPCMpKWZpAfIxmd+uD68QpvIN+wixpFj5ohGFLd+FeaYOb1Wb9QQG2 g+2baFnyvF2Ls7Km3yr/LyeAWKogf1wH4vbCiI9NAHzb6aiUqNvr5Y9o7YtUhygS6HKn q5wQvGo9VTihjSU2vAjCMj9x6BdZNSYedMdOE0gbOfj/V1u9r7P0lC1OJmGkIWALXE0d 1sfw5GCAJ4Gym1oSzmnnrwBmi58ZU39MVVq/5VEGHW23Xj3m6X2Ecf6iHmg/8Na5eqTw HMRWD4k3erFSb98cDybxXXpIuhZPBwk18GsMR5KRl9DCqZdIKLGyUm360JnqjPmOYfn3 WYkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=067fbm9USnrqLGl7GZTeRXxLFHZM5KFAsIgXXn3PwM4=; b=ebJLlwozfcpBr2OJJ5SwUyNwdRtHdGMfhRcchwwZTnhw7s40ynEjmEwv1O02k03NM5 4+5zHEex4HVvI+ZY5k9XRVSP92jyHZuN84yVIQV3HpcrNgzLsfocQH+R0QCnsswI4oCE QBXyPxXN4LBUfupGqTTWjsBL6rCyLGJwQEaKlnZKAnKu/3SNWzaKmyYXygQCUhE96b97 nEnwrCMpY5NMcFmtwskK3FuKBnwlD7JtB1pMa5+HWFYIBujAkCw8QmDYvlfTvvninN9C Ikv6IcfGVifkh1Nus38z33bW7KPUMgkfD3bhgQn7JM2JSfnTD9MWZi3r1FfyhFed4jS8 2h3Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m14-v6si8438191pgc.368.2018.07.23.07.11.47; Mon, 23 Jul 2018 07:12:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388339AbeGWPMS (ORCPT + 99 others); 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