diff options
author | Christian Brauner <brauner@kernel.org> | 2023-11-14 13:27:31 +0100 |
---|---|---|
committer | Carlos Maiolino <cem@kernel.org> | 2023-11-16 10:40:56 +0100 |
commit | faea09b8baa9efff7ce896f8ef5017575ef3994c (patch) | |
tree | a9b9ffd936282e44942be60e0311c4c7dea4640b | |
parent | e01fe994efb34371b42ffaba95cef2b11213742c (diff) | |
download | xfsprogs-dev-faea09b8baa9efff7ce896f8ef5017575ef3994c.tar.gz |
Revert "xfs: switch to multigrain timestamps"
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>
-rw-r--r-- | include/xfs_inode.h | 10 | ||||
-rw-r--r-- | libxfs/xfs_trans_inode.c | 6 |
2 files changed, 4 insertions, 12 deletions
diff --git a/include/xfs_inode.h b/include/xfs_inode.h index dd07d0f34f..986815e5cf 100644 --- a/include/xfs_inode.h +++ b/include/xfs_inode.h @@ -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, diff --git a/libxfs/xfs_trans_inode.c b/libxfs/xfs_trans_inode.c index 7a6ecb5db0..ca8e823762 100644 --- a/libxfs/xfs_trans_inode.c +++ b/libxfs/xfs_trans_inode.c @@ -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; } |