]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
Revert "xfs: switch to multigrain timestamps"
authorChristian Brauner <brauner@kernel.org>
Tue, 14 Nov 2023 12:27:31 +0000 (13:27 +0100)
committerCarlos Maiolino <cem@kernel.org>
Thu, 16 Nov 2023 09:40:56 +0000 (10:40 +0100)
Source kernel commit: f798accd5987dc2280e0ba9055edf1124af46a5f

This reverts commit e44df2664746aed8b6dd5245eb711a0ce33c5cf5.

Users reported regressions due to enabling multi-grained timestamps
unconditionally. As no clear consensus on a solution has come up and the
discussion has gone back to the drawing board revert the infrastructure
changes for. If it isn't code that's here to stay, make it go away.

Message-ID: <20230920-keine-eile-c9755b5825db@brauner>
Acked-by: Jan Kara <jack@suse.cz>
Acked-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
include/xfs_inode.h
libxfs/xfs_trans_inode.c

index dd07d0f34f574dcf2d8729e72fd2a4dc7676196c..986815e5cf75ad17b65610bcdb08ef43479ef4c0 100644 (file)
@@ -69,17 +69,9 @@ static inline void ihold(struct inode *inode)
        inode->i_count++;
 }
 
-/* Userspace does not support multigrain timestamps incore. */
-#define I_CTIME_QUERIED                        (0)
-
 static inline struct timespec64 inode_get_ctime(const struct inode *inode)
 {
-       struct timespec64 ctime;
-
-       ctime.tv_sec = inode->__i_ctime.tv_sec;
-       ctime.tv_nsec = inode->__i_ctime.tv_nsec & ~I_CTIME_QUERIED;
-
-       return ctime;
+       return inode->__i_ctime;
 }
 
 static inline struct timespec64 inode_set_ctime_to_ts(struct inode *inode,
index 7a6ecb5db0d85e3420a9709f09c2e411b93b9325..ca8e823762c9182a75debe257580a7a8303d6fa3 100644 (file)
@@ -59,12 +59,12 @@ xfs_trans_ichgtime(
        ASSERT(tp);
        ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL));
 
-       /* If the mtime changes, then ctime must also change */
-       ASSERT(flags & XFS_ICHGTIME_CHG);
+       tv = current_time(inode);
 
-       tv = inode_set_ctime_current(inode);
        if (flags & XFS_ICHGTIME_MOD)
                inode->i_mtime = tv;
+       if (flags & XFS_ICHGTIME_CHG)
+               inode_set_ctime_to_ts(inode, tv);
        if (flags & XFS_ICHGTIME_CREATE)
                ip->i_crtime = tv;
 }