Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3149262rdh; Thu, 28 Sep 2023 04:20:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEXyCUtC13WMjKaHGmTwGDZEKcPT/V3vwnKwQ9lvjDtO1XrGXnVfDkAMm3nWdPXl1mNtkGX X-Received: by 2002:a17:902:7596:b0:1c7:25fd:661f with SMTP id j22-20020a170902759600b001c725fd661fmr776645pll.42.1695900034304; Thu, 28 Sep 2023 04:20:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900034; cv=none; d=google.com; s=arc-20160816; b=opyN75QguKx5rMF2jys81DeTJbmo5wSy7M6+AQ8ZvZqXxAZWIvcJlvCPk+fs9YD3HV hgJHFzuiYVOracsDJiKVGamAxzgZe//C6w9UsMWNwZ0fkWzkSMq4GZ7xJ4APv/YaSf49 diuh+3Jl7puk3QIVJxZnYl2M0uLqbKeeOIH7WdErkho2lKT+gGr7Jf52HwSVdiqvz6XG 1mZFItIRpSvoOMsls/MUrmRVORnEb6KXhs1YIhYVUSyoQvtJrQe6Z76TvGnWgZXYEx7v vjb/AQ3gV2APhpJBDGV+gv7vS/hluvd6u0FmwVaJcaWESzVuXahr3x8z9cCbxe09jxkS FQtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Q/BcjVmRortTRx6z7Ha8BRdX8RezZqllQqY2YR3xlNQ=; fh=1ts8YaBpHdhauL1JhLd3+yfDH4+ZNqI6GN/ugCTFmCg=; b=kYy4m2R7+rD6nm0AA4d0WZu9fuLXLrILBz0M+xsxyhJsoVpz+tANHSmXBcOT8EbhDD KBDjs22r1wqEn5VycbP8rMPU3N2NMEpzPt277pX0kkIpsossr4SmmK0fK2FoksG9i809 rchQM+6AdVnuuJwkJduvDEN4Cvp6bc7bubXEH174jQr38825hPLSaja6e+FuY2rn9NTL OQ51G4GoALIdYfpoht/gTDiCjXcReUmHNHiZyt3VHXYQA1gXjFy7sMJud9wlHIHks5fa egQhabd/sCyLZrqauzezbBDnq/eifM4UI9cmt/o8OvPrQxSHgmoCP5ufhvmDj2zaSRFW YVMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oF1zJItQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id kx11-20020a170902f94b00b001c62acfa473si7738080plb.62.2023.09.28.04.20.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:20:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oF1zJItQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 96420858E91C; Thu, 28 Sep 2023 04:09:52 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232082AbjI1LJi (ORCPT + 99 others); Thu, 28 Sep 2023 07:09:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231907AbjI1LIj (ORCPT ); Thu, 28 Sep 2023 07:08:39 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A36F81FE1; Thu, 28 Sep 2023 04:05:24 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84F6CC433C8; Thu, 28 Sep 2023 11:05:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899124; bh=s7WS+LV0JB5TQ52AQtIz8N34W96nGx+AXxe0soX68xI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oF1zJItQf+rLBIzreOD0dJy4IIIPXRjAWa3T8dpvvNiVblS7j8VMBuOEuHGsZaEU/ p6R/9HdZgyROZKkkM2vCUlGce3oETFYGLJXxjBKtoeHbL3ZjrHK+MFOw/FflddKB3I dswDue1cOa2SyGYyMsj1uPEWdztszY1qstS6bTMJjYui+hwoFgRPXfFbChtz3kAWAh wFYvAyabav2a6UN4OpbdwaoHr7ZxbMLzgR8s2kuxzfQSC5/PKERxxaPZ1dVAIs1nsK hupdg5UR5C0ZvbK/r5XH3kyY2eRYIfpNY1gLxmLxmL0uN/25yc5sRTTmLKS+XQU0PQ MsBO9P8MVSKxg== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linux-unionfs@vger.kernel.org Subject: [PATCH 59/87] fs/overlayfs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:08 -0400 Message-ID: <20230928110413.33032-58-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-1-jlayton@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 28 Sep 2023 04:09:52 -0700 (PDT) Signed-off-by: Jeff Layton --- fs/overlayfs/file.c | 9 ++++++--- fs/overlayfs/inode.c | 3 ++- fs/overlayfs/util.c | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c index 693971d20280..9b4f5b011e4f 100644 --- a/fs/overlayfs/file.c +++ b/fs/overlayfs/file.c @@ -239,6 +239,7 @@ static void ovl_file_accessed(struct file *file) { struct inode *inode, *upperinode; struct timespec64 ctime, uctime; + struct timespec64 mtime, umtime; if (file->f_flags & O_NOATIME) return; @@ -251,9 +252,11 @@ static void ovl_file_accessed(struct file *file) ctime = inode_get_ctime(inode); uctime = inode_get_ctime(upperinode); - if ((!timespec64_equal(&inode->i_mtime, &upperinode->i_mtime) || - !timespec64_equal(&ctime, &uctime))) { - inode->i_mtime = upperinode->i_mtime; + mtime = inode_get_mtime(inode); + umtime = inode_get_mtime(upperinode); + if ((!timespec64_equal(&mtime, &umtime)) || + !timespec64_equal(&ctime, &uctime)) { + inode_set_mtime_to_ts(inode, inode_get_mtime(upperinode)); inode_set_ctime_to_ts(inode, uctime); } diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c index 83ef66644c21..b6e98a7d36ce 100644 --- a/fs/overlayfs/inode.c +++ b/fs/overlayfs/inode.c @@ -704,7 +704,8 @@ int ovl_update_time(struct inode *inode, int flags) if (upperpath.dentry) { touch_atime(&upperpath); - inode->i_atime = d_inode(upperpath.dentry)->i_atime; + inode_set_atime_to_ts(inode, + inode_get_atime(d_inode(upperpath.dentry))); } } return 0; diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c index 89e0d60d35b6..868afd8834c3 100644 --- a/fs/overlayfs/util.c +++ b/fs/overlayfs/util.c @@ -1409,8 +1409,8 @@ void ovl_copyattr(struct inode *inode) inode->i_uid = vfsuid_into_kuid(vfsuid); inode->i_gid = vfsgid_into_kgid(vfsgid); inode->i_mode = realinode->i_mode; - inode->i_atime = realinode->i_atime; - inode->i_mtime = realinode->i_mtime; + inode_set_atime_to_ts(inode, inode_get_atime(realinode)); + inode_set_mtime_to_ts(inode, inode_get_mtime(realinode)); inode_set_ctime_to_ts(inode, inode_get_ctime(realinode)); i_size_write(inode, i_size_read(realinode)); } -- 2.41.0