Sonoma resets timestamps when renaming files on MSDOS/FAT filesystems

If you rename a file on a MSDOS/FAT filesystem on Sonoma, a few seconds later the OS updates the timestamp of the file to the current time.

$ hdiutil create -size 64m -type SPARSE -fs "MS-DOS FAT32" -volname test1 -attach /tmp/test1.img
/dev/disk3          	FDisk_partition_scheme         	
/dev/disk3s1        	DOS_FAT_32                     	/Volumes/TEST1
created: /tmp/test1.img.sparseimage
$ touch -t 01010000 /Volumes/TEST1/x
$ sleep 5
$ ls -l /Volumes/TEST1/x
-rwx------  1 fred  staff  0 Jan  1  2024 /Volumes/TEST1/x*
$ mv /Volumes/TEST1/x /Volumes/TEST1/y
$ ls -l /Volumes/TEST1/y
-rwx------  1 fred  staff  0 Jan  1  2024 /Volumes/TEST1/y*
$ sleep 5
$ ls -l /Volumes/TEST1/y
-rwx------  1 fred  staff  0 Jul 17 05:57 /Volumes/TEST1/y*
$ date
Wed Jul 17 05:57:09 BST 2024
$ uname -a
Darwin localhost 23.5.0 Darwin Kernel Version 23.5.0: Wed May  1 20:09:52 PDT 2024; root:xnu-10063.121.3~5/RELEASE_X86_64 x86_64

Among the downstream effects of this is if you rsync -t files to a FAT filesystem, if you run the same command again a few seconds after, rsync will copy all the files again because the destination timestamps have not been preserved. This has been reported here: https://forums.developer.apple.com/forums/thread/741490

I was close to downgrading until I found I could use rsync -t --inplace to workaround this but I've not had this problem on Monterey or any prior MacOS release. This definitely seems like a regression in the core OS. Rename should preserve timestamps.

Sounds like a regression. Can you post the bug number?

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

Thanks. Raised FB14464931.

Sonoma resets timestamps when renaming files on MSDOS/FAT filesystems
 
 
Q