Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp462276pxb; Wed, 6 Oct 2021 08:35:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywEpY79Y6xqu5V90mOxtSPvdDZi/yalUWCKhXAObO2CAClxPkfnJxXa1DJnegNwm0+5Kf+ X-Received: by 2002:a17:902:7e44:b0:13e:aaf8:e259 with SMTP id a4-20020a1709027e4400b0013eaaf8e259mr11603281pln.14.1633534555211; Wed, 06 Oct 2021 08:35:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633534555; cv=none; d=google.com; s=arc-20160816; b=GORqi50izyFch5o6IjgG/YuaVBZMfjxPH+9WSRdfuLQYa5w4HMHpsXNsrX0sCd2g9g 3cdPqYmJodcXzh0cyOxbydLEH8OxYvjj5vP2jlpt9pE8qu6mCUYL40tebN6i9On9y3ml M9g9GUvUHH0uB/wFuMxXiGrJFxsgJ8ztoLAD4YGnEV1y5To3hhOVfHyeTy84XuapLEnb ATS3TeDnjkl5asIZFArecVPZXmUeFLafV14v2Y6BpjJmp+QQQZMKgEE+Rr3HwwCSSRmS LMTsY6vPO4H6eUvwuMGlAG3p9eCMoqbPU9Q2fIMQmAQeZzqXBPfni8UpBbmoNXfGEfm/ h6/A== 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=OXGlnNe1yWBSvNniecAJQ/P9MoZJY33TkoAKPrbYOnw=; b=VnfZMhdyCi8i7knhl2F/G9JMQbMVaLi14ki5DIuy2ENIp1MAkOm0gj90GOgbRUSmtj QEFN5H2CtqazinOhQ7p+37c9PQPnyk8dWk9rsEpoxj1ppZAhw4WWg5oyr71muQrBSnsN 39k5JzY3H30d089JKnt7p8FnyhCMl/LQCxtDcja4RjFnEZNOe9V/62lM2yIZDffvjzy5 RO+QsFAXUVvZkAqukoZHlrJ1irpfD61S8R3Tg5WgQNxzU1xXPpf6sVR3bZXzwulF5s1Q OKrv+mQALB12tUEjOcYXecx5PKsQhafLPme1/OJbX//ZRSlg18MMskjfsnCh3H6eO/KR RHng== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=hA1vk31B; 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 o15si6255586pja.139.2021.10.06.08.35.37; Wed, 06 Oct 2021 08:35:55 -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=hA1vk31B; 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 S231293AbhJFPfN (ORCPT + 99 others); Wed, 6 Oct 2021 11:35:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230101AbhJFPfM (ORCPT ); Wed, 6 Oct 2021 11:35:12 -0400 Received: from mail-vs1-xe32.google.com (mail-vs1-xe32.google.com [IPv6:2607:f8b0:4864:20::e32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B5C4C061753 for ; Wed, 6 Oct 2021 08:33:20 -0700 (PDT) Received: by mail-vs1-xe32.google.com with SMTP id 66so3336204vsd.11 for ; Wed, 06 Oct 2021 08:33:20 -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=OXGlnNe1yWBSvNniecAJQ/P9MoZJY33TkoAKPrbYOnw=; b=hA1vk31Bhomcl0BX+2n4o1WOeiN/pLWbs/c79v0uZf04LtAu686+SXWgXbe/RDCfJo kfC8USdT7zxYZS2Jo9c0t57CZzmdZQt8Ydtax4fNW4v3ehrYS23mMWo/TbevMVGvt00q x6WbVkjN6p1MKRQ4u7UHz9vDf0OIYuEGqbt9w= 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=OXGlnNe1yWBSvNniecAJQ/P9MoZJY33TkoAKPrbYOnw=; b=gm1dYS/CQYx9N2H2Uy5pjrvORTnQOSrvkQv7G60SqAvz/y0xRsMjwux71OXI3sR5dX 8VYRQm0Vvj7D9lp0RcsbsofmJfzc/uxWnBW0FUQIuQwYzp6oqzuE/f9WLdfBBxoLn2S1 JoIH06O4O2UZ/I3App5N7DRdznGEeXX2bv78TZb2DMkzvlVK3qcY3cg807BN/1zImLTF mbF52Kss/crcd2arGHjtp2pn17BrCHDvaqGc4wO0gzUODm6tESLy9+iPo9aTBbyax5k/ eKEwD9sI+tJ9QYu/W9++ZHPeRSUajtvToNouhJV510ZWbBCdRTYuy3MdmmVUQgZ3ahxA Fovw== X-Gm-Message-State: AOAM530Kegix3koCmcW9r0QKvD9m3YCj9RDLRq19eKoIzNtTCVtyjTtY dHrcl7SPT7TrCMxlWbisdOb6UWEdVpggp15iyewbxA== X-Received: by 2002:a67:c284:: with SMTP id k4mr6631340vsj.24.1633534399452; Wed, 06 Oct 2021 08:33:19 -0700 (PDT) MIME-Version: 1.0 References: <20210923130814.140814-1-cgxu519@mykernel.net> <20210923130814.140814-4-cgxu519@mykernel.net> In-Reply-To: <20210923130814.140814-4-cgxu519@mykernel.net> From: Miklos Szeredi Date: Wed, 6 Oct 2021 17:33:08 +0200 Message-ID: Subject: Re: [RFC PATCH v5 03/10] ovl: implement overlayfs' ->evict_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' ->evict_inode operation, > so that we can clear dirty flags of overlayfs inode. > > Signed-off-by: Chengguang Xu > --- > fs/overlayfs/super.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c > index 51886ba6130a..2ab77adf7256 100644 > --- a/fs/overlayfs/super.c > +++ b/fs/overlayfs/super.c > @@ -406,11 +406,18 @@ static int ovl_remount(struct super_block *sb, int *flags, char *data) > return ret; > } > > +static void ovl_evict_inode(struct inode *inode) > +{ > + inode->i_state &= ~I_DIRTY_ALL; > + clear_inode(inode); clear_inode() should already clear the dirty flags; the default eviction should work fine without having to define an ->evict_inode. What am I missing? Thanks, Miklos