Re: [PATCH v3 3/3] fat: report creation time in statx
From: Chung-Chiang Cheng
Date: Fri Apr 22 2022 - 04:20:23 EST
> > + } else {
> > fat_truncate_atime(sbi, &inode->i_mtime, &inode->i_atime);
> > + fat_truncate_crtime(sbi, &inode->i_mtime, &MSDOS_I(inode)->i_crtime);
> > + }
>
> Probably, nothing worth to update i_crtime here, right?
>
That's right. I also miss truncating the create-time for newly created
files in vfat. I will add it back in the next patch. It will be the only
location that calls fat_truncate_crtime().
@@ -781,11 +782,12 @@ static int vfat_create(struct user_namespace
*mnt_userns, struct inode *dir,
}
inode_inc_iversion(inode);
fat_truncate_time(inode, &ts, S_ATIME|S_CTIME|S_MTIME);
+ fat_truncate_crtime(...)
I also have a question. If msdos doesn't support create-time, why does the
original fat_truncate_time() truncate it to a 2-sec granularity?
if (flags & S_CTIME) {
if (sbi->options.isvfat)
inode->i_ctime = fat_timespec64_trunc_10ms(*now);
else
inode->i_ctime = fat_timespec64_trunc_2secs(*now);
}
This logic was introduced in 6bb885ecd746 (fat: add functions to update
and truncate timestamps appropriately"), and seems not for change-time.
Should I remove it?
Thanks.