Why default modTimeWindowS to 2 for FAT only on Android?

As far as I understand, the FAT file system uses imprecise timestamps regardless of the OS. What is the reason for applying the default value of 2 on Android only? Would it not be better to always apply it when finding a FAT partition and remove the OS check altogether?

The relevant part of the code:

For reference: https://forum.syncthing.net/t/raspberry-pi-some-receive-only-files-always-get-marked-as-local-additions/16246

There is already a mechanism that deals with any filesystem that does not have nano-second precision: The mtimeFS. Meaning that covers the 2s precision of FAT. That mechanism requires though, that the filesystem is consistent: If it told Syncthing at some point that the mod. time of a file is 01:30:03, when asked again it should say 01:30:03 as well - not 01:30:02. And that’s what a “normal” FAT filesystem does. Android on the other hand puts some virtual filesystem shenanigans on top of FAT, and apparently that changes reported mod. times upon restart (well remount probably). And that’s the problem and that’s why the mod. time window workaround is necessary despite having the mtimeFS.

1 Like

Thank you for the explanation, but what is the deal with that Raspberry Pi then though?

No idea. Looking at that thread I don’t think it has even been established whether modification time is the culprit or not.

1 Like