Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1347495pxb; Thu, 7 Oct 2021 06:06:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLPOG+hju3Z9KXblV6NFhaueHPCko+cQn3aiI4aM2v3Jz9YZGllXHsDEjVz+2eBoownVCu X-Received: by 2002:a17:906:a843:: with SMTP id dx3mr5631881ejb.97.1633612017862; Thu, 07 Oct 2021 06:06:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633612017; cv=none; d=google.com; s=arc-20160816; b=S7QoLCOOal4We4WhvEXZnXJsuzXRMRUhMVBjJkgpwc7SLfysSHUMzSUMmk4TBkO13y dy0r/XYWC3RuiaAh4MhMTvqyh+nAJkmsOgjYBJYpMfs+ACcYqaPVIBkhAbvW5sPcrA4d +Cj5j3SfcBIADc5VZG8HXUpSAuGreGzJpcQA4leGKkYsWfqhD+cAeOEgoFo+rISeGzn8 PvCPw7nEnYHb2OJ2luc6+5USdSNwlm6PHdKgpSzLWC/KzSWM3+CSxSBHy1lgkc5it7Ao AbVwDMsOC1Nltm+KPMsAbsxoqIjpz3FNiggPM9UHuorqyZOpdHAg5r70EYgCNY16LZe4 FU/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=wVGqCEv5OuW11NNJUvfsDwkjHfJJuYc/XpuXB4FLhAc=; b=TPAw6lyEtOhRlheJL54dq8vYHsb5BEVroUkBqR6wR4IryJPrtlFbbCJnLOOqSHjvyl oQEq6tQKqEX8mLt3OZUpgXk0l80c7MA/d3yImfq3gcjyod4lAwp7629VIQcpjRFH5OiT 7+ZhVVHBQEiYiTWvCiImv236ADgMJCfAiQKluSnye1BV5uvlea5EZbICyXt+EcyJktVG w2Gtyz+rsWuVT0v0MNhIDEVRzlfrbTe8lICuUjHP3M3RqvU53Ue6Ff04p2zC7itfaPYX 6pRCjOMmQKobMRhJrT9jCyZBssi7WiO+whmPDdT1XOf/8LRYnhLEdQRXn5cq6+CFOD4b /yCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=Rf8GuXJ7; 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 s11si30589118edi.457.2021.10.07.06.06.32; Thu, 07 Oct 2021 06:06:57 -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=Rf8GuXJ7; 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 S233114AbhJGMr0 (ORCPT + 99 others); Thu, 7 Oct 2021 08:47:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241444AbhJGMrZ (ORCPT ); Thu, 7 Oct 2021 08:47:25 -0400 Received: from mail-vs1-xe2a.google.com (mail-vs1-xe2a.google.com [IPv6:2607:f8b0:4864:20::e2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16E6BC061760 for ; Thu, 7 Oct 2021 05:45:32 -0700 (PDT) Received: by mail-vs1-xe2a.google.com with SMTP id x192so4365149vsx.5 for ; Thu, 07 Oct 2021 05:45:32 -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:content-transfer-encoding; bh=wVGqCEv5OuW11NNJUvfsDwkjHfJJuYc/XpuXB4FLhAc=; b=Rf8GuXJ7M1dKiqO3dvNXK4IDlZxdzcsLOAiqs622DUFDvs2+FoX0siDG7l7JBWAEFS FYI/dFhiPr85/tr4UDhHFOmRdda7+AWL8LphfB1ZP5vUku44Hzy4boBbG3zsz2TDPmuy 5DL5cGMcOj/x7Vi4CsKCiyPW3sESFeeqwkNGI= 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:content-transfer-encoding; bh=wVGqCEv5OuW11NNJUvfsDwkjHfJJuYc/XpuXB4FLhAc=; b=03dfDsB/M0gVrJZyfBz+pNTJVuDja0qPCO144oPdkoblurwUY7rlboEK9U6iX8CvJJ 1gPB6c4j9ZM9Rt7OiQmZzboPHGVbqXKPC2twQtJaPAhczK45DNCZcUhd/umUaQQUDHoQ Oeqd9DGYuE+uIEOcY5xJwB0iX1W2/2dQ+LA112stg1dTsMz1ZzS411CDy5C/pewETtto eGu1irlZDHHpVasdu5eV0INR+Hu4jCTcz72Jqmdx35uK47mZlcP9q8oKGfKyoxJltLaQ tu6u4ueioaiDHI+L1sWGxwi02gp5HA0pTbORSqqHJE3qkZHfxst011/cjEZZtYMSTBGl Nj3w== X-Gm-Message-State: AOAM532lQZOJaT8KCgcdBo5IlWdG8ySwb5A0F4F7Wi0bByM5R/Dllh9/ H7wvap/AZ/NYonZXlkGdGnupFgEVHzorXFoaF9leJA== X-Received: by 2002:a67:ec94:: with SMTP id h20mr3614063vsp.59.1633610731189; Thu, 07 Oct 2021 05:45:31 -0700 (PDT) MIME-Version: 1.0 References: <20210923130814.140814-1-cgxu519@mykernel.net> <20210923130814.140814-7-cgxu519@mykernel.net> <17c5aba1fef.c5c03d5825886.6577730832510234905@mykernel.net> In-Reply-To: <17c5aba1fef.c5c03d5825886.6577730832510234905@mykernel.net> From: Miklos Szeredi Date: Thu, 7 Oct 2021 14:45:20 +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 , overlayfs , linux-kernel Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 7 Oct 2021 at 14:28, Chengguang Xu wrote: > > ---- =E5=9C=A8 =E6=98=9F=E6=9C=9F=E5=9B=9B, 2021-10-07 17:23:06 Miklos S= zeredi =E6=92=B0=E5=86=99 ---- > > On Thu, 23 Sept 2021 at 15:08, Chengguang Xu wr= ote: > > > > > > 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 *inod= e) > > > clear_inode(inode); > > > } > > > > > > +static int ovl_write_inode(struct inode *inode, > > > + struct writeback_control *wbc) > > > +{ > > > + struct ovl_fs *ofs =3D inode->i_sb->s_fs_info; > > > + struct inode *upper =3D ovl_inode_upper(inode); > > > + unsigned long iflag =3D 0; > > > + int ret =3D 0; > > > + > > > + if (!upper) > > > + return 0; > > > + > > > + if (!ovl_should_sync(ofs)) > > > + return 0; > > > + > > > + if (upper->i_sb->s_op->write_inode) > > > + ret =3D upper->i_sb->s_op->write_inode(inode, wbc); > > > > Where is page writeback on upper inode triggered? > > > > Should pass upper inode instead of overlay inode here. That's true and it does seem to indicate lack of thorough testing. However that wasn't what I was asking about. AFAICS ->write_inode() won't start write back for dirty pages. Maybe I'm missing something, but there it looks as if nothing will actually trigger writeback for dirty pages in upper inode. Thanks, Miklos