]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
libxfs: set access time when creating files
authorDarrick J. Wong <djwong@kernel.org>
Wed, 2 Oct 2024 01:11:13 +0000 (18:11 -0700)
committerAndrey Albershteyn <aalbersh@redhat.com>
Fri, 4 Oct 2024 10:42:07 +0000 (12:42 +0200)
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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
libxfs/inode.c

index b302bbbfd3ba7b829478468fbf7182bbdc9ef89f..132cf990dc35126e65914df8492c3846932db66f 100644 (file)
@@ -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);