]> Git Repo - linux.git/commitdiff
exfat: fix ctime is not updated
authorYuezhang Mo <[email protected]>
Tue, 31 Oct 2023 09:36:39 +0000 (17:36 +0800)
committerNamjae Jeon <[email protected]>
Fri, 3 Nov 2023 13:24:11 +0000 (22:24 +0900)
Commit 4c72a36edd54 ("exfat: convert to new timestamp accessors")
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]>
fs/exfat/file.c

index 02c4e2937879e991b640aa9e39e06aa35ca91515..bfdfafe0099309f59da5c19b27eee2f4ed10db31 100644 (file)
@@ -295,6 +295,7 @@ int exfat_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
        if (attr->ia_valid & ATTR_SIZE)
                inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode));
 
+       setattr_copy(&nop_mnt_idmap, inode, attr);
        exfat_truncate_inode_atime(inode);
 
        if (attr->ia_valid & ATTR_SIZE) {
This page took 0.048917 seconds and 4 git commands to generate.