Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2139797ybt; Fri, 3 Jul 2020 01:41:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5bT/H1PC02U95iyZIcEgaEX3zJ6RuICpW4SX5GkLJEshLZkGNk3bqDlirmKE81dExJzrr X-Received: by 2002:a50:d80f:: with SMTP id o15mr40067272edj.156.1593765691639; Fri, 03 Jul 2020 01:41:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593765691; cv=none; d=google.com; s=arc-20160816; b=olyRlD1iqoZn5QY8guDTuaqDeqJCcPlUBdbWduGEhSZAeoL/7WlDST7YNaQl9/LMLA 3OmsGlGasSbtbVyP6+2NjqvneWjg49+iBZSf/V+mlJY9VzFZodbcQYau5LDuBNqMklwf ONH2FmrgEb8Vici4yMt1dF9kC32dGHDV+sevRVCzQRD5jhhrSU9P1C1+12PKUENoRljo opKyFwMOeRqPuJA9Y8z+LIBCyVT//xwANrUzo+Fp+0qTdJuDwqgATpIu4x5eh7/NMaYg DxClESOH/5AWl7giVJiJFR9jEsirbwsLJwzxLrJ5j+rOX3bo1pg0vPCTQgtwrsKt4qxw NnZQ== 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:mime-version :message-id:date:subject:cc:to:from; bh=PnRefA6gvUxV5/0G38abwPT18JSJGtwkykrwqZe+JHs=; b=ofHOQ/VLtHuEJDjPCp33BgCROrG6p2wWBwExIYAbTgIbgWCyu5sQ8UHxdKZxu9r9Pv Xk4d+OJeWeKv5BlUjxqAev6NM6wlwc/CMm4YEYqjLYHXgfSyhfAXxvDDSAbQseTQkZFD h/+DEBpxA/+XM1xExX/eRy4SQxut8X57tkxDOsPtyKPMiAy6R3bJn61gRpnM67xf+/AN 2E9zMJ6H3YDWRY4ytCe8t8ixHQeZOhoYdCejRStBY64LTL4QEZtpXU4g0LSzsno1vhCR 223i2d5zrzs6n7wve3wJRCyNlhE+PycdQvymgXdbYgM9/MYKTmtkPtu4iBCWa8ST3rbH m4Kg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s14si7135615ejq.387.2020.07.03.01.41.07; Fri, 03 Jul 2020 01:41:31 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725949AbgGCIk0 (ORCPT + 99 others); Fri, 3 Jul 2020 04:40:26 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:42622 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725648AbgGCIk0 (ORCPT ); Fri, 3 Jul 2020 04:40:26 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id EC97FCB10AA7DF8419DD; Fri, 3 Jul 2020 16:40:24 +0800 (CST) Received: from szvp000203569.huawei.com (10.120.216.130) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.487.0; Fri, 3 Jul 2020 16:40:18 +0800 From: Chao Yu To: CC: , , , Chao Yu Subject: [PATCH] f2fs: fix to wait GCed compressed page writeback Date: Fri, 3 Jul 2020 16:40:11 +0800 Message-ID: <20200703084011.42755-1-yuchao0@huawei.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.120.216.130] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org like we did for encrypted page. Signed-off-by: Chao Yu --- fs/f2fs/compress.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c index b3ecf7d4d6d8..3a847bc36748 100644 --- a/fs/f2fs/compress.c +++ b/fs/f2fs/compress.c @@ -1152,6 +1152,13 @@ static int f2fs_write_compressed_pages(struct compress_ctx *cc, f2fs_set_compressed_page(cc->cpages[i], inode, cc->rpages[i + 1]->index, cic); fio.compressed_page = cc->cpages[i]; + + fio.old_blkaddr = data_blkaddr(dn.inode, dn.node_page, + dn.ofs_in_node + i + 1); + + /* wait for GCed page writeback via META_MAPPING */ + f2fs_wait_on_block_writeback(inode, fio.old_blkaddr); + if (fio.encrypted) { fio.page = cc->rpages[i + 1]; err = f2fs_encrypt_one_page(&fio); -- 2.26.2