Skip to content

Commit fc12a72

Browse files
YuezhangMonamjaejeon
authored andcommitted
exfat: fix setting uninitialized time to ctime/atime
An uninitialized time is set to ctime/atime in __exfat_write_inode(). It causes xfstests generic/003 and generic/192 to fail. And since there will be a time gap between setting ctime/atime to the inode and writing back the inode, so ctime/atime should not be set again when writing back the inode. Fixes: 4c72a36 ("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]>
1 parent 8f6f76a commit fc12a72

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/exfat/inode.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,18 @@ int __exfat_write_inode(struct inode *inode, int sync)
5656
&ep->dentry.file.create_time,
5757
&ep->dentry.file.create_date,
5858
&ep->dentry.file.create_time_cs);
59+
ts = inode_get_mtime(inode);
5960
exfat_set_entry_time(sbi, &ts,
6061
&ep->dentry.file.modify_tz,
6162
&ep->dentry.file.modify_time,
6263
&ep->dentry.file.modify_date,
6364
&ep->dentry.file.modify_time_cs);
64-
inode_set_mtime_to_ts(inode, ts);
65+
ts = inode_get_atime(inode);
6566
exfat_set_entry_time(sbi, &ts,
6667
&ep->dentry.file.access_tz,
6768
&ep->dentry.file.access_time,
6869
&ep->dentry.file.access_date,
6970
NULL);
70-
inode_set_atime_to_ts(inode, ts);
7171

7272
/* File size should be zero if there is no cluster allocated */
7373
on_disk_size = i_size_read(inode);

0 commit comments

Comments
 (0)