Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1095343pxf; Fri, 26 Mar 2021 00:35:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmP2aXGSMpWuhZ7HlZK5BX1oQbDzFY99Nv9mG8A9ko5HxY77+x6pp/TIjGcrHWBpGwl/5c X-Received: by 2002:a05:6402:1a4f:: with SMTP id bf15mr13435251edb.304.1616744134695; Fri, 26 Mar 2021 00:35:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616744134; cv=none; d=google.com; s=arc-20160816; b=0PDCXd31icwEzjrvwSkK9Fjddww5S6RwntQGQny9VkPY82o2wbACY6kRqMmNrk//sD 2n8+luCfREtGdVxeabSI+HqNKmAaI9B0WPN6HBzqnq9NRarCXDFJe7OzwbGSr1+bXKOg EQi+A8dtNj14qwyfjP+i8YH/fjIU1Ug7PiB6AQW8qOQJzksJ7CPTKw8fSMNnMB7hRAH4 If2zwLBWc8kygEJsAi3ME553BXX4WB2l/3gaVP7Li/MHMNA84AEM4gPDczB1F26KBLkD 2WiMhegQcOem1jukIcoc8B/40xZqwZDnhlE3SzC6DEXVwWva4pBd+WC27Zyz1Z+4oom/ SuPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=F9L6A6ctK8SIY7jRrh/6Z0pPbOLKcXKNKcPV879c2gQ=; b=D7WQWK+vSTL4tZ+iefI0+Vw0u0iNaGD2XbkG1UNnrgbDIWEEHcP7n7wKaFQm9ohwnV n2RPLqHmGIPM1E8vFEKr/t41HjgH5g0zxkoqXzkbyXsGfnBbGxu4BvnczXR1aBmQeHM/ a7M4oq5qaf3fhCsXODCF4PScwpoutwpv6XEobkjBZ5onVOEmmQsWjnlXR0ixnUb+SgM4 l/ktMgK5GfSnjKM5GLRt0vtxuFQoWuXhPDLfYTe7iVvR/rZJhbTt9ta0wKmHgk67TVRU GYeBr672y0X2vQKluddunrrzMgsVXV5hWcfxBNRAmSYDw9urekun+fJeIbu4Z5hJcWCF QY5Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w25si6203342ejv.100.2021.03.26.00.35.09; Fri, 26 Mar 2021 00:35:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230063AbhCZHd7 (ORCPT + 99 others); Fri, 26 Mar 2021 03:33:59 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:14149 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229812AbhCZHdY (ORCPT ); Fri, 26 Mar 2021 03:33:24 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4F6DCt1LM0znWrS; Fri, 26 Mar 2021 15:30:50 +0800 (CST) Received: from [10.136.110.154] (10.136.110.154) by smtp.huawei.com (10.3.19.214) with Microsoft SMTP Server (TLS) id 14.3.498.0; Fri, 26 Mar 2021 15:33:22 +0800 Subject: Re: [PATCH v2] f2fs: fix to avoid touching checkpointed data in get_victim() To: Jaegeuk Kim CC: , , References: <20210324031828.67133-1-yuchao0@huawei.com> From: Chao Yu Message-ID: <2dfb085b-80ce-050b-5650-986675a07488@huawei.com> Date: Fri, 26 Mar 2021 15:33:22 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.136.110.154] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/3/25 7:49, Jaegeuk Kim wrote: > On 03/24, Chao Yu wrote: >> In CP disabling mode, there are two issues when using LFS or SSR | AT_SSR >> mode to select victim: >> >> 1. LFS is set to find source section during GC, the victim should have >> no checkpointed data, since after GC, section could not be set free for >> reuse. >> >> Previously, we only check valid chpt blocks in current segment rather >> than section, fix it. >> >> 2. SSR | AT_SSR are set to find target segment for writes which can be >> fully filled by checkpointed and newly written blocks, we should never >> select such segment, otherwise it can cause panic or data corruption >> during allocation, potential case is described as below: >> >> a) target segment has 128 ckpt valid blocks >> b) GC migrates 'n' (n < 512) valid blocks to other segment (segment is >> still in dirty list) I missed to change 128 to n, so comments should be updated as below: a) target segment has 'n' (n < 512) ckpt valid blocks b) GC migrates 'n' valid blocks to other segment (segment is still in dirty list) Thanks, >> c) GC migrates '512 - n' blocks to target segment (segment has 'n' >> cp_vblocks and '512 - n' vblocks) >> d) If GC selects target segment via {AT,}SSR allocator, however there >> is no free space in targe segment.