Skip to content

Commit

Permalink
exfat: fix ctime is not updated
Browse files Browse the repository at this point in the history
Commit 4c72a36edd54 removed attr_copy() from exfat_set_attr().
It causes xfstests generic/221 to fail. In xfstests generic/221,
it tests ctime should be updated even if futimens() update atime
only. But in this case, ctime will not be updated if attr_copy()
is removed.

attr_copy() may also update other attributes, and removing it may
cause other bugs, so this commit restores to call attr_copy() in
exfat_set_attr().

Fixes: 4c72a36edd54 ("exfat: convert to new timestamp accessors")
Signed-off-by: Yuezhang Mo <[email protected]>
Reviewed-by: Andy Wu <[email protected]>
Reviewed-by: Aoyama Wataru <[email protected]>
Reviewed-by: Sungjong Seo <[email protected]>
Signed-off-by: Namjae Jeon <[email protected]>
  • Loading branch information
YuezhangMo authored and namjaejeon committed Nov 3, 2023
1 parent 327699f commit 3ad1490
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions file.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ int exfat_setattr(struct dentry *dentry, struct iattr *attr)
#endif

#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 7, 0)
setattr_copy(&nop_mnt_idmap, inode, attr);
exfat_truncate_inode_atime(inode);
#else
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 12, 0)
Expand Down

0 comments on commit 3ad1490

Please sign in to comment.