From 168c404d455db0f4068dd6d5570d7d75c6b84812 Mon Sep 17 00:00:00 2001 From: Rob Norris Date: Sun, 14 Jan 2024 13:46:06 +1100 Subject: [PATCH] zfs_setattr: fix atime update In db4fc559c I messed up and changed this bit of code to set the inode atime to an uninitialised value, when actually it was just supposed to loading the atime from the inode to be stored in the SA. This changes it to what it should have been. Signed-off-by: Rob Norris Sponsored-by: https://despairlabs.com/sponsor/ Fixes: #15762 --- module/os/linux/zfs/zfs_vnops_os.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/module/os/linux/zfs/zfs_vnops_os.c b/module/os/linux/zfs/zfs_vnops_os.c index 65d1d786ae5a..9ea8ad5f4a65 100644 --- a/module/os/linux/zfs/zfs_vnops_os.c +++ b/module/os/linux/zfs/zfs_vnops_os.c @@ -2435,9 +2435,8 @@ zfs_setattr(znode_t *zp, vattr_t *vap, int flags, cred_t *cr, zidmap_t *mnt_ns) if ((mask & ATTR_ATIME) || zp->z_atime_dirty) { zp->z_atime_dirty = B_FALSE; - inode_timespec_t tmp_atime; + inode_timespec_t tmp_atime = zpl_inode_get_atime(ip); ZFS_TIME_ENCODE(&tmp_atime, atime); - zpl_inode_set_atime_to_ts(ZTOI(zp), tmp_atime); SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_ATIME(zfsvfs), NULL, &atime, sizeof (atime)); }