Skip to content

fix: rename directories on rclone mounts - #35

Merged
thisisgm merged 1 commit into
thisisgm:mainfrom
nixfred:fix/rclone-directory-rename
Sep 6, 2026
Merged

thisisgm merged 1 commit into
thisisgm:mainfrom
nixfred:fix/rclone-directory-rename

Conversation

@nixfred

@nixfred nixfred commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

What was wrong

Creating a folder on an rclone FUSE mount succeeded, but Flea immediately opened its name editor and the submit failed with EINVAL. That made New Folder look broken and prevented Rename from working in mounts such as ~/google.

Flea correctly uses Linux renameat2(..., RENAME_NOREPLACE) to guarantee it never overwrites an existing target. rclone 1.75 rejects that flag for directory renames even though its ordinary directory-move path works and refuses an occupied destination.

Fix

  • keep the atomic RENAME_NOREPLACE path as the default
  • on EINVAL, allow the compatibility path only for a real directory on a mount identified exactly as fuse.rclone
  • decode mountinfo paths and use the deepest enclosing mount, so a nested non-rclone mount never inherits the exception
  • preserve Flea's stable EEXIST collision result before the fallback; rclone's own directory move is authoritative if a destination races into existence
  • never use the fallback for files, symlinks, or other filesystems

Verification

  • Reproduced the original backend failure on the real ~/google rclone mount
  • Verified rename succeeds there after the fix
  • Verified an occupied target is not overwritten and both directories remain
  • cargo build and cargo build --release
  • cargo test and cargo test --release — 342 passed in each profile
  • ./tests/run-all.sh twice — 10 suites, 0 failed; 1,153 JS checks each run
  • ./tools/flea-qmllint-gate — 0 regressions
  • ./tools/flea-file-budget
  • git diff --check

No issue filed.

Fall back from unsupported RENAME_NOREPLACE only for directories on fuse.rclone. Preserve no-clobber behavior with an explicit collision check and rclone's directory-move contract, while keeping files and other filesystems on the atomic path.
@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 6 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 0cd5159b-c90e-4203-b440-ca1367f4a59d

📥 Commits

Reviewing files that changed from the base of the PR and between 979ad25 and 6dfcd07.

📒 Files selected for processing (4)
  • AGENTS.md
  • src/backend/mod.rs
  • src/backend/ops.rs
  • src/backend/renamecompat.rs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nixfred nixfred mentioned this pull request Sep 4, 2026
10 of 11 tasks
@thisisgm
thisisgm merged commit 3db9914 into thisisgm:main Sep 6, 2026
1 check passed
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