Skip to content

Commit f798acc

Browse files
committed
Revert "xfs: switch to multigrain timestamps"
This reverts commit e44df26. 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>
1 parent db58b5e commit f798acc

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

fs/xfs/libxfs/xfs_trans_inode.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ xfs_trans_ichgtime(
6262
ASSERT(tp);
6363
ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL));
6464

65-
/* If the mtime changes, then ctime must also change */
66-
ASSERT(flags & XFS_ICHGTIME_CHG);
65+
tv = current_time(inode);
6766

68-
tv = inode_set_ctime_current(inode);
6967
if (flags & XFS_ICHGTIME_MOD)
7068
inode->i_mtime = tv;
69+
if (flags & XFS_ICHGTIME_CHG)
70+
inode_set_ctime_to_ts(inode, tv);
7171
if (flags & XFS_ICHGTIME_CREATE)
7272
ip->i_crtime = tv;
7373
}

fs/xfs/xfs_iops.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -573,10 +573,10 @@ xfs_vn_getattr(
573573
stat->gid = vfsgid_into_kgid(vfsgid);
574574
stat->ino = ip->i_ino;
575575
stat->atime = inode->i_atime;
576+
stat->mtime = inode->i_mtime;
577+
stat->ctime = inode_get_ctime(inode);
576578
stat->blocks = XFS_FSB_TO_BB(mp, ip->i_nblocks + ip->i_delayed_blks);
577579

578-
fill_mg_cmtime(stat, request_mask, inode);
579-
580580
if (xfs_has_v3inodes(mp)) {
581581
if (request_mask & STATX_BTIME) {
582582
stat->result_mask |= STATX_BTIME;
@@ -917,7 +917,7 @@ xfs_setattr_size(
917917
if (newsize != oldsize &&
918918
!(iattr->ia_valid & (ATTR_CTIME | ATTR_MTIME))) {
919919
iattr->ia_ctime = iattr->ia_mtime =
920-
current_mgtime(inode);
920+
current_time(inode);
921921
iattr->ia_valid |= ATTR_CTIME | ATTR_MTIME;
922922
}
923923

fs/xfs/xfs_super.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2065,7 +2065,7 @@ static struct file_system_type xfs_fs_type = {
20652065
.init_fs_context = xfs_init_fs_context,
20662066
.parameters = xfs_fs_parameters,
20672067
.kill_sb = xfs_kill_sb,
2068-
.fs_flags = FS_REQUIRES_DEV | FS_ALLOW_IDMAP | FS_MGTIME,
2068+
.fs_flags = FS_REQUIRES_DEV | FS_ALLOW_IDMAP,
20692069
};
20702070
MODULE_ALIAS_FS("xfs");
20712071

0 commit comments

Comments
 (0)