Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp573628pxb; Thu, 23 Sep 2021 06:28:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRfp83e8xvAwY00NJMC3foAJQJFqZP/a5hYrXamDtVDIcrwVOFFm5snaLlRK7yWbrMs3ML X-Received: by 2002:a17:906:3a4d:: with SMTP id a13mr5073728ejf.220.1632403729562; Thu, 23 Sep 2021 06:28:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1632403729; cv=pass; d=google.com; s=arc-20160816; b=sW7fq6noQR30m2u0rFp+AKY8HCNvHgsKSL24YY9u1jyBt0m0VFGIwM8ZMZxhc1EJgE FaNUJ7ZvDU1xAfRzRYD6DARxggPh0zSF9Kb6CRXj1rP+0/JWyRTWY7BfKziqQlxDVktg NgjJ7nm2OH5AF+nDLwnItB8Ic/Z49rZxwSryw+boQolJT9jaZtxPo6XMMCMcw8aZYhqr COE+s0zJyNvWP1FiukbGIg1DObO11EH7a4DmT9wPRhNuP3B1G7HwYJjDY7EsmYR23cl4 kWkgewbhIQn4YAmw0fyyHBTJZO55PCgEpsFjbtja8PdgAUqagmhgCzSDLzb20xEUYYA9 9RiA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:subject:message-id:cc:to:from :dkim-signature; bh=oG9u6AuZGZnG2KRRqhJabX8iiojey6H8VgFRc9r8zZI=; b=DxU4UQeWK3VjjImdF7bR0andnarGH9piW2Stnwx+HYLihPtWA+Ys0XWxN0lDwvEQ6w z89bUW5xUupITXlXLotKhJWTHWjSGcHkzt6E6Rg0OVZrSRKcLCtivZaorCwNvMJkx6Dn 0exVqnmNTvh/yXigROWcAVG/QiD+R1f9hcVQi+jcrB4HeHAluABqoDYFcK4j20Hy+raC fnRiIQPUy2Ih9sPNv1QexXuogUOqV+0RP9iHWYj/2BlZ+uOqE+YUOU+KtnyMvdUrQkrD c9zgDfCxP1Pq+/stWYsVYehaUfz2nyLKCPwPqmjI3QM3uXCncJV/YO8tIiPtdNKxHy85 /etQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mykernel.net header.s=zohomail header.b=XJQM+4b0; arc=pass (i=1 spf=pass spfdomain=mykernel.net dkim=pass dkdomain=mykernel.net dmarc=pass fromdomain=mykernel.net>); 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 s7si6489688edi.502.2021.09.23.06.28.25; Thu, 23 Sep 2021 06:28:49 -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; dkim=pass header.i=@mykernel.net header.s=zohomail header.b=XJQM+4b0; arc=pass (i=1 spf=pass spfdomain=mykernel.net dkim=pass dkdomain=mykernel.net dmarc=pass fromdomain=mykernel.net>); 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 S241499AbhIWN0Z (ORCPT + 99 others); Thu, 23 Sep 2021 09:26:25 -0400 Received: from sender2-op-o12.zoho.com.cn ([163.53.93.243]:17232 "EHLO sender2-op-o12.zoho.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241431AbhIWNZ7 (ORCPT ); Thu, 23 Sep 2021 09:25:59 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1632402523; cv=none; d=zoho.com.cn; s=zohoarc; b=f2h811w2svJQ4VmTGeEPdH8ik/s9xSbE+Y2NhLHm4skAElJ4FYA4xm5dEZGFMAi1TGnQJewLXfnkxfoHMNJGI3jNPYuLd4vA0vip+HcqcY+zwSgNfsMa1ORU7ggfUWGi3pDN72aPTjEogAu7+kShz6Zh98ewPabDJhBOXBqL4xc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com.cn; s=zohoarc; t=1632402523; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=oG9u6AuZGZnG2KRRqhJabX8iiojey6H8VgFRc9r8zZI=; b=VkcPKRSjcPvbDFAsHX4SaX3tRDA349fSUPEhiU7yZblCVudkVNhNPAh8EjSEhhquivpvlX/Y2+ep4mRONhMq5NdadZqjKW0IrEbQ9WE1ncQejOM9iLp0VN/EcTaYok3dknMfKuY1V952v6eneT6XYeQERXol7ZFqmkrrvyDNUhQ= ARC-Authentication-Results: i=1; mx.zoho.com.cn; dkim=pass header.i=mykernel.net; spf=pass smtp.mailfrom=cgxu519@mykernel.net; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1632402523; s=zohomail; d=mykernel.net; i=cgxu519@mykernel.net; h=From:To:Cc:Message-ID:Subject:Date:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Content-Type; bh=oG9u6AuZGZnG2KRRqhJabX8iiojey6H8VgFRc9r8zZI=; b=XJQM+4b0CJp8iL2K71cfogKzVBIQgvz8ktaI3l4hTq+Fyn3vaxMs2Vo46b6Ap2Di 78la47q64qXuBX4hgyzGubgPeER3oS7CfGs3fPVN3BhSN+j/VOtQeUBJaqdqXFZLaJS Tft2OQcHcIoZ55Cvjh/9z2MNFtN00A1UW+hZ7vXA= Received: from localhost.localdomain (81.71.33.115 [81.71.33.115]) by mx.zoho.com.cn with SMTPS id 1632402522914922.0766031758626; Thu, 23 Sep 2021 21:08:42 +0800 (CST) From: Chengguang Xu To: miklos@szeredi.hu, jack@suse.cz, amir73il@gmail.com Cc: linux-fsdevel@vger.kernel.org, linux-unionfs@vger.kernel.org, linux-kernel@vger.kernel.org, Chengguang Xu Message-ID: <20210923130814.140814-11-cgxu519@mykernel.net> Subject: [RFC PATCH v5 10/10] ovl: implement containerized syncfs for overlayfs Date: Thu, 23 Sep 2021 21:08:14 +0800 X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210923130814.140814-1-cgxu519@mykernel.net> References: <20210923130814.140814-1-cgxu519@mykernel.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoCNMailClient: External Content-Type: text/plain; charset=utf8 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now overlayfs can sync proper dirty inodes during syncfs, so remove unnecessary sync_filesystem() on upper file system. Signed-off-by: Chengguang Xu --- fs/overlayfs/super.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index bf4000eb9be8..ef998ada6cb9 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c @@ -15,6 +15,7 @@ #include #include #include +#include #include "overlayfs.h" =20 MODULE_AUTHOR("Miklos Szeredi "); @@ -281,18 +282,15 @@ static int ovl_sync_fs(struct super_block *sb, int wa= it) =09/* =09 * Not called for sync(2) call or an emergency sync (SB_I_SKIP_SYNC). =09 * All the super blocks will be iterated, including upper_sb. -=09 * -=09 * If this is a syncfs(2) call, then we do need to call -=09 * sync_filesystem() on upper_sb, but enough if we do it when being -=09 * called with wait =3D=3D 1. =09 */ -=09if (!wait) -=09=09return 0; =20 =09upper_sb =3D ovl_upper_mnt(ofs)->mnt_sb; =20 =09down_read(&upper_sb->s_umount); -=09ret =3D sync_filesystem(upper_sb); +=09if (wait) +=09=09wait_sb_inodes(upper_sb); + +=09ret =3D sync_fs_and_blockdev(upper_sb, wait); =09up_read(&upper_sb->s_umount); =20 =09return ret; --=20 2.27.0