Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp10489549rwd; Thu, 22 Jun 2023 00:13:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6IHXJCWU9/JMJQMtXQnbvhvkoiQdKg7NEMDttiSt+Neb+2XLNSWrr6d/DXQWPE29p2mzqY X-Received: by 2002:a17:902:8e89:b0:1ac:7245:ba5a with SMTP id bg9-20020a1709028e8900b001ac7245ba5amr6487062plb.61.1687417984377; Thu, 22 Jun 2023 00:13:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687417984; cv=none; d=google.com; s=arc-20160816; b=t24vzfhQ99oDX9tw3kHThjYU2jPxVgfGJqG4cGJ50reLuIZVjhMUE9tZqp6iXerU3g I81eB/62t5yaIZomce16o4PVamt1ROaKwUyuR47NJiIBD6mY2NL54A3Bvg2WCqH4HiHp 4KajLh8zAsA68HGkiwrQWwMvxdgHu2Fc06FxDVwKJYapWZwZzBcri6nCrt+iX+++t4T1 4u8VDjmI4kreb2yfEvUNbJ4zr7wAZLYn/EyELHRHWH5IvvDGRHtbHaRcvLnBxuCDJWgo s2S5H9TBFIsmyRUgGKWfyQqbcoptQ/0+H5gnXgHMcQDzyFnj/jH6UxA3qFy6dX7ezvdb K2wA== 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=zLj587xVoRgqRKhRrCaStNTVfSpf62GN7fanQWD11SU=; b=Avubxii3TQtsebNn75EEBg0jr+AKqDqKgS9q8mEnIy+5jYHVfc/sZ6DOWjZ0Phn/Du N2DEkmF7G5P+70r76rvG6vU5UwX6oGa3F2oGjFbI8szwSzomLM7u7URxig9js8uGBNqm Bp9ezQ0zaejO1UkosLmoyMsOyoMX+7eLwSC9u4nKGV93fnWS/K1pCwEd4Fs3GqMpz9By L7DJY/YZDjZmwRgEVMCL9WKG869aeVyK77ATnPbSu3VCETuINa+xHw4nU4HcQC6jf5+3 +lYD2kltbIHRug2T0mgaAb3Al9QusGSL8UnAARuYFmDN6Ppnwq+W6M44bXWH50LZUFDB O7UA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=pAYd6nAP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k13-20020a170902c40d00b001b02658db01si2227220plk.580.2023.06.22.00.12.52; Thu, 22 Jun 2023 00:13:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=pAYd6nAP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230252AbjFVGo5 (ORCPT + 99 others); Thu, 22 Jun 2023 02:44:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230080AbjFVGoz (ORCPT ); Thu, 22 Jun 2023 02:44:55 -0400 Received: from mail-vk1-xa35.google.com (mail-vk1-xa35.google.com [IPv6:2607:f8b0:4864:20::a35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E39B1BCD; Wed, 21 Jun 2023 23:44:51 -0700 (PDT) Received: by mail-vk1-xa35.google.com with SMTP id 71dfb90a1353d-4715cbe0422so2086297e0c.3; Wed, 21 Jun 2023 23:44:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687416290; x=1690008290; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=zLj587xVoRgqRKhRrCaStNTVfSpf62GN7fanQWD11SU=; b=pAYd6nAPjPRzKeYBogRAlKwoLK8J7LQEL1liFk+ROKA8FpeX30A32TuvQupOzDgJIq k2eS2rI+bikqGPN6YOuK12NdohOKlsiWggSznnqOp4RUDaL479dBdqtILEVuxBJmDj52 GgWehiWyVo9dlXpUZmF3SrZMBtRYbRwOvgUDgbPo2TJlfYDZIYVr7rgM14VhSiv4Mo5L eZVnkce3ml2MPUyy+lD9vHgf7QF+fVJGs6WqCi4C/2ok6yNJwbgyH5YlZRIR/B8LfcNG S6we4Joo6eF2y+maoJBmKuyZKM7i5ORrsqll3ksncuvSCUsVJSoE7BfjHAxoxXCblpj3 txVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687416290; x=1690008290; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zLj587xVoRgqRKhRrCaStNTVfSpf62GN7fanQWD11SU=; b=MQdPNlnRIdgECOnOzxeaPfPCOguhVSiqBNoOHrRm81By7gDu0wzEojkz7F6akujpI7 f2B6vktdQqYG+gbfE7vvnTSNcKJ7Thj136Tjw6a1rpwZlpHDSyF14LRmU93OW6Wt/Xrx ZCyw7mlgIwlsagLAVomuImTFs3rWyA0IUi8oEcRS26M5R9eVVeAo/A9aLT1wXDCSnqUS sO+S8orv/FLrdoq1g17FuUW7QL/ZnpcpvOd6FzNZ0mbSmgPoblPSuAKPp0/h7armIh7s Snt/pAyvfPKaRnHKTNu0rueBzL+2qByNCgKJb+iUq9INOLyXklA6biqo3ifdz51qM1U3 En0w== X-Gm-Message-State: AC+VfDw1/daNLT+sVCoJGDjqQxswNXAa2pve9+fjlyK4NAHl1fysurEJ vBhlOgyl35k5Ubt3DyAL4n5AYvv/cdXtflGZL1c= X-Received: by 2002:a1f:c14e:0:b0:46e:8724:5dbb with SMTP id r75-20020a1fc14e000000b0046e87245dbbmr6011900vkf.2.1687416290370; Wed, 21 Jun 2023 23:44:50 -0700 (PDT) MIME-Version: 1.0 References: <20230621144507.55591-1-jlayton@kernel.org> <20230621144735.55953-1-jlayton@kernel.org> <20230621144735.55953-53-jlayton@kernel.org> In-Reply-To: <20230621144735.55953-53-jlayton@kernel.org> From: Amir Goldstein Date: Thu, 22 Jun 2023 09:44:39 +0300 Message-ID: Subject: Re: [PATCH 54/79] overlayfs: switch to new ctime accessors To: Jeff Layton Cc: Christian Brauner , Miklos Szeredi , Al Viro , Jan Kara , linux-unionfs@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 21, 2023 at 5:54=E2=80=AFPM Jeff Layton wr= ote: > > In later patches, we're going to change how the ctime.tv_nsec field is > utilized. Switch to using accessor functions instead of raw accesses of > inode->i_ctime. > > Signed-off-by: Jeff Layton > --- Looks ok. Reviewed-by: Amir Goldstein Thanks, Amir. > fs/overlayfs/file.c | 7 +++++-- > fs/overlayfs/util.c | 2 +- > 2 files changed, 6 insertions(+), 3 deletions(-) > > diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c > index 21245b00722a..b47013d4bd4e 100644 > --- a/fs/overlayfs/file.c > +++ b/fs/overlayfs/file.c > @@ -239,6 +239,7 @@ static loff_t ovl_llseek(struct file *file, loff_t of= fset, int whence) > static void ovl_file_accessed(struct file *file) > { > struct inode *inode, *upperinode; > + struct timespec64 ct, uct; > > if (file->f_flags & O_NOATIME) > return; > @@ -249,10 +250,12 @@ static void ovl_file_accessed(struct file *file) > if (!upperinode) > return; > > + ct =3D inode_ctime_peek(inode); > + uct =3D inode_ctime_peek(upperinode); > if ((!timespec64_equal(&inode->i_mtime, &upperinode->i_mtime) || > - !timespec64_equal(&inode->i_ctime, &upperinode->i_ctime))) { > + !timespec64_equal(&ct, &uct))) { > inode->i_mtime =3D upperinode->i_mtime; > - inode->i_ctime =3D upperinode->i_ctime; > + inode_ctime_set(inode, uct); > } > > touch_atime(&file->f_path); > diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c > index 7ef9e13c404a..e3746f9a202f 100644 > --- a/fs/overlayfs/util.c > +++ b/fs/overlayfs/util.c > @@ -1202,6 +1202,6 @@ void ovl_copyattr(struct inode *inode) > inode->i_mode =3D realinode->i_mode; > inode->i_atime =3D realinode->i_atime; > inode->i_mtime =3D realinode->i_mtime; > - inode->i_ctime =3D realinode->i_ctime; > + inode_ctime_set(inode, inode_ctime_peek(realinode)); > i_size_write(inode, i_size_read(realinode)); > } > -- > 2.41.0 >