diff mbox series

[13/64] libxfs: set access time when creating files

Message ID 172783101977.4036371.15734675602815750733.stgit@frogsfrogsfrogs (mailing list archive)
State New
Headers show
Series [01/64] xfs: avoid redundant AGFL buffer invalidation | expand

Commit Message

Darrick J. Wong Oct. 2, 2024, 1:11 a.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

Set the access time on files that we're creating, to match the behavior
of the kernel.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 libxfs/inode.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Christoph Hellwig Oct. 2, 2024, 5:49 a.m. UTC | #1
On Tue, Oct 01, 2024 at 06:11:13PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> Set the access time on files that we're creating, to match the behavior
> of the kernel.

The only caveat here could be the special use of th atime for the
rtbitmap inode, but that's taken care of by explicitly clearing the
field later, so:

Reviewed-by: Christoph Hellwig <hch@lst.de>
diff mbox series

Patch

diff --git a/libxfs/inode.c b/libxfs/inode.c
index b302bbbfd..132cf990d 100644
--- a/libxfs/inode.c
+++ b/libxfs/inode.c
@@ -94,7 +94,8 @@  libxfs_icreate(
 	struct inode		*inode;
 	struct xfs_inode	*ip;
 	unsigned int		flags;
-	int			times = XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG;
+	int			times = XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG |
+					XFS_ICHGTIME_ACCESS;
 	int			error;
 
 	error = libxfs_iget(mp, tp, ino, XFS_IGET_CREATE, &ip);