The patch titled Subject: fat: truncate inode timestamp updates in setattr has been added to the -mm tree. Its filename is fat-truncate-inode-timestamp-updates-in-setattr.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/fat-truncate-inode-timestamp-updates-in-setattr.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/fat-truncate-inode-timestamp-updates-in-setattr.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Frank Sorenson <sorenson@xxxxxxxxxx> Subject: fat: truncate inode timestamp updates in setattr setattr_copy can't truncate timestamps correctly for msdos/vfat, so truncate and copy them ourselves. Link: http://lkml.kernel.org/r/a2b4701b1125573fafaeaae6802050ca86d6f8cc.1538363961.git.sorenson@xxxxxxxxxx Signed-off-by: Frank Sorenson <sorenson@xxxxxxxxxx> Acked-by: OGAWA Hirofumi <hirofumi@xxxxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- --- a/fs/fat/file.c~fat-truncate-inode-timestamp-updates-in-setattr +++ a/fs/fat/file.c @@ -542,6 +542,18 @@ int fat_setattr(struct dentry *dentry, s up_write(&MSDOS_I(inode)->truncate_lock); } + /* + * setattr_copy can't truncate these appropriately, so we'll + * copy them ourselves + */ + if (attr->ia_valid & ATTR_ATIME) + fat_truncate_time(inode, &attr->ia_atime, S_ATIME); + if (attr->ia_valid & ATTR_CTIME) + fat_truncate_time(inode, &attr->ia_ctime, S_CTIME); + if (attr->ia_valid & ATTR_MTIME) + fat_truncate_time(inode, &attr->ia_mtime, S_MTIME); + attr->ia_valid &= ~(ATTR_ATIME|ATTR_CTIME|ATTR_MTIME); + setattr_copy(inode, attr); mark_inode_dirty(inode); out: _ Patches currently in -mm which might be from sorenson@xxxxxxxxxx are fat-create-a-function-to-calculate-the-timezone-offest.patch fat-add-functions-to-update-and-truncate-timestamps-appropriately.patch fat-change-timestamp-updates-to-use-fat_truncate_time.patch fat-truncate-inode-timestamp-updates-in-setattr.patch