Skip to content

Commit

Permalink
zfs_setattr: fix atime update
Browse files Browse the repository at this point in the history
In db4fc55 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 <[email protected]>
Sponsered-by: https://despairlabs.com/sponsor/
Fixes: openzfs#15762
  • Loading branch information
robn committed Jan 14, 2024
1 parent a1771d2 commit 07c7932
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions module/os/linux/zfs/zfs_vnops_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -2439,9 +2439,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));
}
Expand Down

0 comments on commit 07c7932

Please sign in to comment.