Repository navigation
fix(relocation): allow case-only renames on case-sensitive file systems - #1451
Merged
Merged
Conversation
Foowy
marked this pull request as ready for review
October 6, 2026 20:52
revam
requested changes
Oct 7, 2026
Foowy
force-pushed
the
fix/relocation-case-only-rename
branch
from
October 8, 2026 13:54
9881f1d to
a254f03
Compare
revam
requested changes
Oct 8, 2026
Foowy
force-pushed
the
fix/relocation-case-only-rename
branch
from
October 8, 2026 17:51
a254f03 to
a4a4b3c
Compare
The same-location guard in `InternalDirectlyRelocateFile` aborted every path that differed only by case, even where the file system treats them as different paths. - Aborted only when the new path exists and is the same file as the old one - Added `ReuseExistingFolderCase` so a folder differing only by case from an existing one is reused rather than duplicated
Foowy
force-pushed
the
fix/relocation-case-only-rename
branch
from
October 9, 2026 17:15
a4a4b3c to
1f29659
Compare
revam
approved these changes
Oct 10, 2026
revam
requested changes
Oct 10, 2026
|
revam
approved these changes
Oct 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Problem
InternalDirectlyRelocateFileaborts any relocation where the old and new paths are equal ignoring case but not exactly equal, with:That is only true on a case-insensitive file system. On a case-sensitive system the two paths are different locations and the rename is valid, so the guard blocks legitimate renames. The only symptom is an Error-level log line per file. The files keep their old capitalization and are never renamed.
This matters for anyone whose managed folder currently lives on a case-sensitive file system:
Fooandfooare separate names. DSM keeps shared folder names case-insensitive (see the DSM shared folder spec), but that does not extend to the paths inside a share. Other NAS stacks built on Linux file systems (QNAP, Unraid on XFS, TrueNAS on ZFS) may have the same property, depending on how the volume or dataset was created.+Fon an empty directory) per the kernel ext4 docs, so ext4 is case-sensitive unless someone enables it.casesensitivityproperty defaults tosensitiveand cannot be changed after the dataset is created per the OpenZFS docs, so existing datasets stay case-sensitive.Real case from my library: the relocation target for a series folder changed capitalization (
...so I Tried...vs...So I Tried...) after a title update. Rerunning rename logged 14 aborts and changed nothing.Change
GetVideoFileUID, or either id unavailable). That keeps the abort on case-insensitive file systems, including Windows, macOS and SMB-backed mounts, and lets a case-only file rename through on case-sensitive ones.ReuseExistingFolderCase. Before the path is used, each directory in the new relative path is matched against what exists on disk. If a directory differing only by case exists, it is reused instead of creating a second, case-variant folder. In the case above the new path resolves to the existing one and the relocation becomes a no-op.Behavior notes
Testing
Unit tests in
VideoRelocationGuardTestscover folder reuse, no reuse when nothing matches, and the abort when it can't be verified that a case-variant path is the same file. FullShoko.Testspasses.Run against a real server on a Synology Btrfs share mounted over NFSv4.1, using truncated copies of the affected files from the log (real names, 2 MiB each), through the
File/Location/{id}relocate endpoint.Review changes
.tmp-nametemp path, with file watcher exclusions, so it also works on case-insensitive file systems.Rebase history
80f1a7a6c, no conflicts6b4bfca9d, no conflicts