Received: by 10.223.185.116 with SMTP id b49csp859885wrg; Sat, 10 Feb 2018 22:19:09 -0800 (PST) X-Google-Smtp-Source: AH8x224kRJRIhzdl82X/ikxzJ4IiEGwSUO0IFAPsAZkaEDb3twoPrxxzumbsPiuphAhfeUYPNgmW X-Received: by 10.99.102.1 with SMTP id a1mr6453708pgc.452.1518329948997; Sat, 10 Feb 2018 22:19:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518329948; cv=none; d=google.com; s=arc-20160816; b=k/t6MB8tMtofX4W66Fmt7DCrHBgG/4ItHDjsPiUBhD7yUcTBgqTrm4HFnOuOqOcgZx P//6G8wiW9OJBj4j28lfSunwnDcHmtATq/48lH8wdZRRHvvZz8AcPyczKwUXTv6xAJnz VwqbWQX5Wglnq//1WgEqpp7b16OlJxYVXLkbct48T+ifc3X45UkZH4HUe1Sus6tVrSgz P/kIc1yBEP9pvbAlrYBDrGBp5IJYBuOezu4u6e/zf3ZxmAu9xPlaaX+53mEQk2Piem6Q cw278ji9vo5/1uetGQiGXPfAxZHhurBFi5O14OtHw0WIrkrWq+bjlNRanIbUii5ntALF vlMw== 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=ocg3pb0lPVg2O4pHqLyuMEYDF91TauxbYS1S2wiT2g4=; b=grNvgv1gvRikNj8qgd7vMr1sKK2FqjIHnmIboCaarSPC002fEoGovTdBJBawCCOCYE m9d2PvQhm5N0vY63ueq9nFs82zhTLUxCZp7fT1Mt24szZGW9uEvQKP+95PF8etQp7q0E qj35s4T0z2UHt9iinoLfCLNCxl2cHj+lrBzx5PuhrQT8v4wEhYW/kKexyDN3y+x3WFBy bLnGCXA8PPjqiHo5r+16Hi3mpnHXFvLoKN7+VnH7xHAvWMTpIg05t7ba1CGFVrbbK3hL a2TSBXSeQ6GjSQK4mWMxb8HApcrVSTwiAh1e7WoMigMWJDxVVczNhOT/wMB7p5AZEU1/ Vvbg== 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 o3-v6si2474192pld.405.2018.02.10.22.18.19; Sat, 10 Feb 2018 22:19:08 -0800 (PST) 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 S1752504AbeBKGQa (ORCPT + 99 others); Sun, 11 Feb 2018 01:16:30 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:46632 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1750787AbeBKGQ3 (ORCPT ); Sun, 11 Feb 2018 01:16:29 -0500 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 852F4EB5D6924; Sun, 11 Feb 2018 14:16:15 +0800 (CST) Received: from [127.0.0.1] (10.111.220.140) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.361.1; Sun, 11 Feb 2018 14:16:07 +0800 Subject: Re: [PATCH] f2fs: set_code_data in move_data_block To: Chao Yu , , , CC: , , , , , References: <1518093217-123705-1-git-send-email-yunlong.song@huawei.com> <520ce370-daa0-0654-3992-be01e8d82607@huawei.com> From: Yunlong Song Message-ID: <8856fc96-03a8-b2d8-8639-512ba2ecb893@huawei.com> Date: Sun, 11 Feb 2018 14:15:45 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <520ce370-daa0-0654-3992-be01e8d82607@huawei.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.111.220.140] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org OK, Got it. On 2018/2/11 11:50, Chao Yu wrote: > On 2018/2/11 11:34, Yunlong Song wrote: >> Ping... >> >> move_data_block misses set_cold_data, then the F2FS_WB_CP_DATA will >> lack these data pages in move_data_block, and write_checkpoint can >> not make sure this pages committed to the flash. > > Hmm.. data block migration is running based on meta inode, so it will > be safe since checkpoint will flush all meta pages including encrypted > pages cached in meta inode? > > Thanks, > >> >> On 2018/2/8 20:33, Yunlong Song wrote: >>> Signed-off-by: Yunlong Song >>> --- >>> fs/f2fs/gc.c | 1 + >>> 1 file changed, 1 insertion(+) >>> >>> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c >>> index b9d93fd..2095630 100644 >>> --- a/fs/f2fs/gc.c >>> +++ b/fs/f2fs/gc.c >>> @@ -692,6 +692,7 @@ static void move_data_block(struct inode *inode, block_t bidx, >>> fio.op = REQ_OP_WRITE; >>> fio.op_flags = REQ_SYNC; >>> fio.new_blkaddr = newaddr; >>> + set_cold_data(fio.page); >>> err = f2fs_submit_page_write(&fio); >>> if (err) { >>> if (PageWriteback(fio.encrypted_page)) >>> >> > > > . > -- Thanks, Yunlong Song