Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1122264pxb; Thu, 7 Oct 2021 00:56:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHLvgMPo6dKGpaF3+RK95GQ+jAEm7o1SP6mw5YMBXK2EWQuBjR6In0V3RaEQQAmv2YL5lq X-Received: by 2002:a17:906:2706:: with SMTP id z6mr3793729ejc.551.1633593405286; Thu, 07 Oct 2021 00:56:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633593405; cv=none; d=google.com; s=arc-20160816; b=eax9YKiAQFwUUf9NOG5lUKrPgSy4r47K4FG3O64i+dnlJ05y8zWksz6WEyxxVIr+20 LsZj4I7wqutkEmFeLM9GLEP3PlMHoeHsC78IlWd1uZpc3IVd8MLAHx3vDKwK34wU5JDL ahr474dVqqqkYl4Ol+vimvNeGq16DkL/fib5JF0vywMordAl1j0/UHOe4y/gxk6DsSZM b8PndUdoEjHC7ntJFjpX8waeDBd2Y9+i1KtSVtZ33YvJKPw7ZpeU+jl8SgoDQs7JDAQq LIxqPDfkASafKWHOXCj93bcG8b/raOHju3y7/Fd4Mn8w2WJsBPGPM1Emo9zq36Zx3YsY D+uw== 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=J5MitxDy+0H9+Hdt9WDFvZicHxHGsD1a80GgYOJsjVg=; b=EVN/MfcDj686MgETQy6CxZmp4xdW71ox3xVvA82sdQSFhHLUGXC8aEMXYFU9JCSSLY sjg1hNZ2+PjRBxb06a6TFLw1QnzxecaBX/JVdSwMn+ytZkd9S5cSz0R4pJHaA6hoPLRm DA9QLZy1pBRQfmF4Rco/qUDkj2nUIwJSLPEMEv3J1zvKbxYNa4Is+Kdkfl+992R/KQxW leS9XKrHSGZhlru1iIXZlQlLbYNlRCmtfLSpL6NzPstknjm4Mq3Q8Azm9SCjRfsayuDR 7yAIOH21YfD4hMeKlkOAU07+u/G47pc4kkErRDlELTiT2THoSTgqg7dEPFqrvbW1bbQ4 iM9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=c6lI7pFq; 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 t29si20204956edc.27.2021.10.07.00.56.21; Thu, 07 Oct 2021 00:56:45 -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=c6lI7pFq; 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 S240459AbhJGHpz (ORCPT + 99 others); Thu, 7 Oct 2021 03:45:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240434AbhJGHpy (ORCPT ); Thu, 7 Oct 2021 03:45:54 -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 7D85CC061755 for ; Thu, 7 Oct 2021 00:44:01 -0700 (PDT) Received: by mail-vs1-xe2a.google.com with SMTP id y28so5798424vsd.3 for ; Thu, 07 Oct 2021 00:44:01 -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=J5MitxDy+0H9+Hdt9WDFvZicHxHGsD1a80GgYOJsjVg=; b=c6lI7pFqiczF2Ff2onEgRJQw9MJ5EyY4HgiVZI+81mj4MhCxupIgf8uI0rlm/EWL4j ac5eVhn+M6gxDI06/kXAhmcEXcv3IZve/52m5P5/oRGkp8yHbor4ZtcYvxGxgVLXjWgh i8A37sO1Unf8qWKg7QKOJn4wP+FOMfAO/VYW0= 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=J5MitxDy+0H9+Hdt9WDFvZicHxHGsD1a80GgYOJsjVg=; b=1YG7K8crozTnggIjm6PAe6De5iDlIDTvx9R3OO+FE+i0G6+sX27uqPlGCrtXlqin8D BEKpu6H4E5QLIsKLKVgbhOMYtsatHWXC6E2yGIvgnuVevqfueppH5ot3EOjvWXQbs1CO M2gpv7h8guEn4ZvCWFASBsmJQrI6jhuHhfrT3weDXA49n108jkQVfoFTDYNzmYbXvi16 MAL2FUpRPkCMgPcz0A3+qRgpenu2WmkQ2Xd2sG5mUfcZ9RR5FgngyhCjWWcyYeIhPwts KDnpCUuwcjMLj/9BzBwzm2nMeyoGAITRQokXbjhS1vSbamCTg4bJTs3oCj30DJKkFCXm z8Pg== X-Gm-Message-State: AOAM533gp2TL1LmTdTvmqHJsukK6mqk0b0Yvzphv2s9etEjJajhySiSi Xq61vWdFa6j32nCq/PUH31vv/Qo+f77N+RDAx2K3+Q== X-Received: by 2002:a05:6102:370c:: with SMTP id s12mr2672780vst.42.1633592640623; Thu, 07 Oct 2021 00:44:00 -0700 (PDT) MIME-Version: 1.0 References: <20210923130814.140814-1-cgxu519@mykernel.net> <20210923130814.140814-4-cgxu519@mykernel.net> In-Reply-To: From: Miklos Szeredi Date: Thu, 7 Oct 2021 09:43:49 +0200 Message-ID: Subject: Re: [RFC PATCH v5 03/10] ovl: implement overlayfs' ->evict_inode operation To: Chengguang Xu Cc: Chengguang Xu , Jan Kara , Amir Goldstein , linux-fsdevel@vger.kernel.org, overlayfs , linux-kernel@vger.kernel.org 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 08:08, Chengguang Xu wrote: > > =E5=9C=A8 2021/10/6 23:33, Miklos Szeredi =E5=86=99=E9=81=93: > > On Thu, 23 Sept 2021 at 15:08, Chengguang Xu wro= te: > >> 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, i= nt *flags, char *data) > >> return ret; > >> } > >> > >> +static void ovl_evict_inode(struct inode *inode) > >> +{ > >> + inode->i_state &=3D ~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? > > Yeah, you are right, we don't need overlayfs' own ->evict_inode anymore > > because we wait all writeback upper inodes in overlayfs' ->sync_fs. Okay, I dropped this patch then. Thanks, Miklos