Skip to content

Fix bug #1122 - mishandling of ExFAT filesystem - #1168

Open
Artur2048 wants to merge 1 commit into
bcpierce00:masterfrom
Artur2048:fix-exfat-fastscan
Open

Fix bug #1122 - mishandling of ExFAT filesystem#1168
Artur2048 wants to merge 1 commit into
bcpierce00:masterfrom
Artur2048:fix-exfat-fastscan

Conversation

@Artur2048

Copy link
Copy Markdown

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 dirFastcheck mechanism 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: dirFastcheck is 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 dirFastcheck for ExFAT filesystems on all platforms, not just Windows.

This change:

  • Guarantees correct change detection on ExFAT regardless of which OS is currently running Unison.
  • Has almost no performance impact (fastcheck mechanism is still used, only dirFastcheck is disabled)
  • Avoids exposing a new configuration option 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:

  • Before the patch: adding files from Windows → Unison reports replicas in sync.
  • After the patch: changes are correctly detected and propagated.

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

… to detect changes made by other systems. Disabling dirFastCheck on ExFAT regardless of OS.
@gdt

gdt commented Jan 17, 2026

Copy link
Copy Markdown
Collaborator

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants