Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp6484709imm; Mon, 23 Jul 2018 19:54:08 -0700 (PDT) X-Google-Smtp-Source: AAOMgpejy1yX5sPkTzw+SyZ5SUQKAmCTa2OjW4B7usutlID1U3cgWYqV8ycTbKEbh1KDcG/BlMgW X-Received: by 2002:a62:ec41:: with SMTP id k62-v6mr15684622pfh.206.1532400848290; Mon, 23 Jul 2018 19:54:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532400848; cv=none; d=google.com; s=arc-20160816; b=wdjesJh9DEZMhy8Zik1sbKuIzfoWxsY9ikZ/3knJiOyc2zLzXwvT+M+g8yDBEubLpp 9wcITnK0LDHmR3lk0kPgyb1q9V0S281fTYKUJJDuscM314xVQkyk2+b3pXOU7pqSz8v0 4161jsuzCcnc7Y31Q5GpArmgk439TG30hMvyNU/6YH69P8RAzn4A90ztxEJxaHkOzBXt YY/p3slpRmVXbWAaaHuFKYmkIfHlfyNWyWpff/Nky3JvkNtoEIFPXzBCpT+YBpTWTAzS PJn+aIwwzeej9tR6MtKgeHr8bfT/DPV3YKGxiYAPYF+sOGbWZkFZ2C9ZTH4OIk7L96CR BkiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=otSB7pwmAgP0utbd9VO8Q9yLlw1OC2P15YdB2tuHsPY=; b=UZ52zwAmn3/R2ZPhZ33mcYmmuThaIudrhG8EdOaybUmuETGD0aJYSoeIojfLzCAF9K J09KRsn7YUNVEx63tFPZ4gzbkVPpHQMmyCnbezct/NOb8zBJ4XmT2mBZ51J8Mo6Z0x9W OmbeF+nTU3bSindKfnQCetOkn9u7Q/BuQ5ZLxsWTftxxAoTrVDxjtmFuCFzts3MO/i/A JGxtYkTeNFlArt43B4YSIwt5zIJZSZ52sCg33z6pqW3J8DguNVwKKzlHMdvN31XUeYtz 5IisOgR6yXmMbi1VLPbN3CT2d3TiF5dADLrPHqa9zwDglKu9SVfn2VFr8rmL+TMOg0a8 zuKA== 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 e12-v6si10611468pfd.38.2018.07.23.19.53.53; Mon, 23 Jul 2018 19:54:08 -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 S2388439AbeGXD5R (ORCPT + 99 others); Mon, 23 Jul 2018 23:57:17 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:58860 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388263AbeGXD5R (ORCPT ); Mon, 23 Jul 2018 23:57:17 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 5A68F2CD69BEB; Tue, 24 Jul 2018 10:53:00 +0800 (CST) Received: from [127.0.0.1] (10.134.22.195) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.382.0; Tue, 24 Jul 2018 10:52:54 +0800 Subject: Re: [PATCH 1/5] f2fs: clear victim_secmap when section has full valid blocks To: Yunlong Song , , , CC: , , , , , References: <1532355022-163029-1-git-send-email-yunlong.song@huawei.com> <1532355022-163029-2-git-send-email-yunlong.song@huawei.com> From: Chao Yu Message-ID: Date: Tue, 24 Jul 2018 10:52:54 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1532355022-163029-2-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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/7/23 22:10, Yunlong Song wrote: > Without this patch, f2fs only clears victim_secmap when it finds out > that the section has no valid blocks at all, but forgets to clear the > victim_secmap when the whole section has full valid blocks. > > Signed-off-by: Yunlong Song > --- > fs/f2fs/segment.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c > index cfff7cf..255bff5 100644 > --- a/fs/f2fs/segment.c > +++ b/fs/f2fs/segment.c > @@ -776,7 +776,9 @@ static void __remove_dirty_segment(struct f2fs_sb_info *sbi, unsigned int segno, > if (test_and_clear_bit(segno, dirty_i->dirty_segmap[t])) > dirty_i->nr_dirty[t]--; > > - if (get_valid_blocks(sbi, segno, true) == 0) > + if (get_valid_blocks(sbi, segno, true) == 0 || > + get_valid_blocks(sbi, segno, true) == > + (sbi->segs_per_sec << sbi->log_blocks_per_seg)) BLKS_PER_SEC(sbi)? Thanks, > clear_bit(GET_SEC_FROM_SEG(sbi, segno), > dirty_i->victim_secmap); > } >