Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1179132pxb; Thu, 7 Oct 2021 02:26:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwh4j6D+48SFY0PisCAEjIBALbqdmSwHV4mcNqFieudl8r0HbVvoVByyv5cidpe61Rtb8OI X-Received: by 2002:a17:90a:a585:: with SMTP id b5mr4152025pjq.97.1633598813085; Thu, 07 Oct 2021 02:26:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633598813; cv=none; d=google.com; s=arc-20160816; b=0tc42Yerjzhr4SI2meRzcfz/Bh3wWWrw+8rDjW9nWcGgxZGQXU+1yv9eQEek15hXPg Ri0HBWJilfYbuu/ZPUQFd0dtx1k3J5HblW64+HoFUTDNhj8fWkbqDauAhaIi8CXnNnUB rgSlgdcMaWPhcqCXS8l9VMUtqWQs0DxfZJcQOYEmDr5wbPKxFItbH63FjqyKOXfS8TpY cVzC6maByzTgQAacdvQ3fHz6ydGMuYtAWiN4uVlTBGJ6dIuwaAZwaLePvSo2ZUd8dbuu fdPEeSBSquEP9Iv6aOelTivlLX/nWVLHnvwHqZ7MznTlvqYRuPOAGIEsfz0tmQUb2lVb wVag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=rUWh8/nzui59AslYBGE2UZsOtVDOFLafNPVpXzsA5k0=; b=LKJlNWqnBRT/fKOlgCkPlKrDjLWNIjLOllbBhCIT2TF9CQhszZxy2xrRR3GTziP0fq 5r5RIX+3LMA3SPuGH3XKXaq8Fzt7Cw776eOMQ5STOmzn+US52Mmll+XqMpQ21p82hYwm YCojJkq348BliW8my7KWzN7cnQ+3HniMAayu13gZ6m+AFI4Vp5kcBSvUAM+RWs3rQfEg Xi3KYJg/4BhSGBUbpjh63RoGTzcmo0CPmqOtg7P9CzwoMj4mSkjKPLUluveXbRHKallZ dVL1mKlAj0aozL0h5KWMD6DypHK27LzsulZicJBx9fKAibTfyhs4CuaFjJZ03EN01Y44 YhAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=LdQoTfuI; 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 z13si30604122pff.176.2021.10.07.02.26.39; Thu, 07 Oct 2021 02:26:53 -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=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=LdQoTfuI; 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 S240592AbhJGJZM (ORCPT + 99 others); Thu, 7 Oct 2021 05:25:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240518AbhJGJZM (ORCPT ); Thu, 7 Oct 2021 05:25:12 -0400 Received: from mail-vs1-xe30.google.com (mail-vs1-xe30.google.com [IPv6:2607:f8b0:4864:20::e30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 836C9C061746 for ; Thu, 7 Oct 2021 02:23:18 -0700 (PDT) Received: by mail-vs1-xe30.google.com with SMTP id x192so3799203vsx.5 for ; Thu, 07 Oct 2021 02:23:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=rUWh8/nzui59AslYBGE2UZsOtVDOFLafNPVpXzsA5k0=; b=LdQoTfuILlI4bUYn34I0nglU9SK7YTIYJZ8ovMH6IzZzlwbsBelfcMO6mz/t0TnDgD 9NPHc4AyQZxZvAwaiUbbANwYwj3v8nKg6Vwt4cJ/16oOLdhsHBKolnYGkem7Lnhbop1S u5EvLLkgZIayXwvPzfuUYzNF+SENB3fb1JF74= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=rUWh8/nzui59AslYBGE2UZsOtVDOFLafNPVpXzsA5k0=; b=s3O7w569PZECHTHk1VhnU//Hhtb2pSu3c8CZhvhCHf5C5siyD3q8A9hrfSB8cZ4pmN v2lfCdvX08Vd021/lcKDU4KRa6p5m9F2LDNPtNmIAoOWFniYDBz0VPeU1KGACOTUVid+ 4QG617njI5gam/aGF5iWwS+T9fk8lHCwKcJEBNGjYns15+ZVcenUzvVuCDk+Ng4mfgYe SsLMp/zt05j4sNV7nkNyy26EU7zBPVFosGc+fBdaPdYy0lEHD/Me+xJsuhhI1Bc9HI46 wNGy3T2nj7M0s7teGrWG4PzkpyQEFzEHumxwj/r1ggaZwkQTdCjhixR8hGCz05wVRM1d lQkA== X-Gm-Message-State: AOAM533Bv3JbEJiBc8JJgek4Nm9B3EkqkhFPh9bF+FrpuyuasdSzcLPp cbCHaHCIa1A/7g9sLLbAdGUcvPCNloQOuc+l7jEb7g== X-Received: by 2002:a67:ec94:: with SMTP id h20mr2591162vsp.59.1633598597621; Thu, 07 Oct 2021 02:23:17 -0700 (PDT) MIME-Version: 1.0 References: <20210923130814.140814-1-cgxu519@mykernel.net> <20210923130814.140814-7-cgxu519@mykernel.net> In-Reply-To: <20210923130814.140814-7-cgxu519@mykernel.net> From: Miklos Szeredi Date: Thu, 7 Oct 2021 11:23:06 +0200 Message-ID: Subject: Re: [RFC PATCH v5 06/10] ovl: implement overlayfs' ->write_inode operation To: Chengguang Xu Cc: Jan Kara , Amir Goldstein , linux-fsdevel@vger.kernel.org, overlayfs , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 23 Sept 2021 at 15:08, Chengguang Xu wrote: > > Implement overlayfs' ->write_inode to sync dirty data > and redirty overlayfs' inode if necessary. > > Signed-off-by: Chengguang Xu > --- > fs/overlayfs/super.c | 30 ++++++++++++++++++++++++++++++ > 1 file changed, 30 insertions(+) > > diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c > index 2ab77adf7256..cddae3ca2fa5 100644 > --- a/fs/overlayfs/super.c > +++ b/fs/overlayfs/super.c > @@ -412,12 +412,42 @@ static void ovl_evict_inode(struct inode *inode) > clear_inode(inode); > } > > +static int ovl_write_inode(struct inode *inode, > + struct writeback_control *wbc) > +{ > + struct ovl_fs *ofs = inode->i_sb->s_fs_info; > + struct inode *upper = ovl_inode_upper(inode); > + unsigned long iflag = 0; > + int ret = 0; > + > + if (!upper) > + return 0; > + > + if (!ovl_should_sync(ofs)) > + return 0; > + > + if (upper->i_sb->s_op->write_inode) > + ret = upper->i_sb->s_op->write_inode(inode, wbc); Where is page writeback on upper inode triggered? Thanks, Miklos