On Thu, Apr 28, 2022 at 1:45 AM OGAWA Hirofumi <hirofumi@xxxxxxxxxxxxxxxxxx> wrote: > Probably, above should be the follow line? > > fat_truncate_crtime(MSDOS_SB(sb), &ts, &MSDOS_I(inode)->i_crtime); > > And furthermore, this is missing to add it to mkdir(2)? And another one, > we would have to update vfat_build_slots() for crtime? I'm not checking > fully though, this seems to need isvfat test > > fat_time_unix2fat(sbi, ts, &time, &date, &time_cs); > de->time = de->ctime = time; > de->date = de->cdate = de->adate = date; > de->ctime_cs = time_cs; Ah, you're right. I missed vfat_mkdir() in the previous patch. After further study, I found that maybe we can remove fat_truncate_crtime() in both vfat_create() and vfat_mkdir(). crtime will come from only these two cases: (1) read from disk (2) generated in vfat_build_slots() They are all in {cdate:16, ctime:16, ctime_cs:8} format, which ensures crtime will be kept at the correct granularity (10 ms). The remaining timestamps may be copied from the vfs inode, so we need to truncate them to fit FAT's format. But crtime doesn't need to do that. Thanks.