Fix bug #1122 - mishandling of ExFAT filesystem - #1168
Conversation
… to detect changes made by other systems. Disabling dirFastCheck on ExFAT regardless of OS.
|
As I read your diff, it does not implement the approach discussed in #1130 -- but your comment in #1130 says that the issue is 'fixed", in a way that I intended to convey was not acceptable. In #1122 I said "without impairing performance for those with non-defective systems". So far, it seems no one has reported this bug to MS. If you think I'm confused in reading your patch, and that it really does meet the intent of #1130, please explain. If you think I'm not confused in understanding what your PR does, and that we simply have a disagreement about which parties in the software world should be accomodated at the expense of which other parties, that's something else. For me it is a fundamental philosophical point that Free Software users should not have any negatives imposed on them because of problems with proprietary software. (Of course, you are welcome to run whatever modified code you wish, to distribute it under unison's license, and to point it out to others on the users list. I would ask only that it be clear to recipients that it's different.) |
Pull Request Description
Problem
Unison running on Linux currently fails to detect file changes on ExFAT filesystems when they are modified by a different operating system than the one running Unison.
This happens because ExFAT implementations across operating systems (Windows, cameras, etc.) do not consistently update directory modification times when files are added or changed.
Unison’s
dirFastcheckmechanism relies on directory modification times, which works reliably only on Unix-style filesystems. On ExFAT, this leads to false “everything is in sync” reports even when the remote replica has new or modified files.A partial workaround already exists in Unison:
dirFastcheckis automatically disabled when Unison is running on Windows. However, no such protection exists on Linux, even though ExFAT volumes mounted under Linux are very often shared with other systems (USB drives, SD cards from cameras, external disks used by Windows machines, etc.).(the currently existing workaround only fixes the issue if Unison is run on Windows, leaving Linux installation vulnerable)
Solution
Disable
dirFastcheckfor ExFAT filesystems on all platforms, not just Windows.This change:
fastcheckmechanism is still used, onlydirFastcheckis disabled)dirFastcheck, which would make Unison configuration unnecessarily complicated.Real-world impact of the bug
Without this fix, users syncing an ExFAT-formatted USB stick, external HDD, second partition of internal HDD, or camera SD card from a Linux machine will frequently see Unison report “no changes” after new photos or files have been added by another device or OS, leading to silent data loss in one direction.
Testing
Verified on Linux with an ExFAT-formatted USB drive:
This brings ExFAT behavior in line with the existing Windows workaround and makes Unison safe to use with typical cross-platform removable media.
ref. #1122 and #1130