Skip to content

Fix file rename on FUSE-based filesystems#51779

Merged
nathansobo merged 1 commit intozed-industries:mainfrom
OmChillure:fix-file-rename-on-fuse-based-filesystems
Mar 18, 2026
Merged

Fix file rename on FUSE-based filesystems#51779
nathansobo merged 1 commit intozed-industries:mainfrom
OmChillure:fix-file-rename-on-fuse-based-filesystems

Conversation

@OmChillure
Copy link
Copy Markdown
Contributor

@OmChillure OmChillure commented Mar 17, 2026

Fixes #51778

Fix

  • Add EINVAL to the list of error codes that trigger the metadata-based rename fallback in crates/fs/src/fs.rs
  • FUSE filesystems (NTFS via ntfs-3g, exFAT, etc.) return EINVAL when renameat2 is called with RENAME_NOREPLACE, since they don't support the flag.
  • The existing fallback already handles ENOSYS, ENOTSUP, and EOPNOTSUPP for similar unsupported-operation cases.

Video

Screencast.from.2026-03-17.23-37-35.webm

Release Notes:

  • Fixed file and directory renaming failing in the project panel on FUSE-based filesystems (e.g. NTFS, exFAT drives on Linux).

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Mar 17, 2026
@zed-community-bot zed-community-bot bot added the guild Pull requests by someone in Zed Guild. NOTE: the label application is automated via github actions label Mar 17, 2026
Copy link
Copy Markdown
Contributor

@nathansobo nathansobo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable enough. Thanks for your help!

@nathansobo nathansobo merged commit 7340835 into zed-industries:main Mar 18, 2026
41 checks passed
AmaanBilwar pushed a commit to AmaanBilwar/zed that referenced this pull request Mar 20, 2026
Fixes zed-industries#51778

#### Fix

- Add `EINVAL` to the list of error codes that trigger the
metadata-based rename fallback in `crates/fs/src/fs.rs`
- FUSE filesystems (NTFS via ntfs-3g, exFAT, etc.) return `EINVAL` when
`renameat2` is called with `RENAME_NOREPLACE`, since they don't support
the flag.
- The existing fallback already handles `ENOSYS`, `ENOTSUP`, and
`EOPNOTSUPP` for similar unsupported-operation cases.

#### Video

[Screencast from 2026-03-17
23-37-35.webm](https://github.com/user-attachments/assets/77e35d97-a87c-4acf-99b8-0e74df667275)

Release Notes:

- Fixed file and directory renaming failing in the project panel on
FUSE-based filesystems (e.g. NTFS, exFAT drives on Linux).
toshmukhamedov pushed a commit to toshmukhamedov/zed that referenced this pull request Mar 20, 2026
Fixes zed-industries#51778

#### Fix

- Add `EINVAL` to the list of error codes that trigger the
metadata-based rename fallback in `crates/fs/src/fs.rs`
- FUSE filesystems (NTFS via ntfs-3g, exFAT, etc.) return `EINVAL` when
`renameat2` is called with `RENAME_NOREPLACE`, since they don't support
the flag.
- The existing fallback already handles `ENOSYS`, `ENOTSUP`, and
`EOPNOTSUPP` for similar unsupported-operation cases.

#### Video

[Screencast from 2026-03-17
23-37-35.webm](https://github.com/user-attachments/assets/77e35d97-a87c-4acf-99b8-0e74df667275)

Release Notes:

- Fixed file and directory renaming failing in the project panel on
FUSE-based filesystems (e.g. NTFS, exFAT drives on Linux).
AmaanBilwar pushed a commit to AmaanBilwar/zed that referenced this pull request Mar 23, 2026
Fixes zed-industries#51778

#### Fix

- Add `EINVAL` to the list of error codes that trigger the
metadata-based rename fallback in `crates/fs/src/fs.rs`
- FUSE filesystems (NTFS via ntfs-3g, exFAT, etc.) return `EINVAL` when
`renameat2` is called with `RENAME_NOREPLACE`, since they don't support
the flag.
- The existing fallback already handles `ENOSYS`, `ENOTSUP`, and
`EOPNOTSUPP` for similar unsupported-operation cases.

#### Video

[Screencast from 2026-03-17
23-37-35.webm](https://github.com/user-attachments/assets/77e35d97-a87c-4acf-99b8-0e74df667275)

Release Notes:

- Fixed file and directory renaming failing in the project panel on
FUSE-based filesystems (e.g. NTFS, exFAT drives on Linux).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement guild Pull requests by someone in Zed Guild. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Renaming files/directories fails on FUSE-based filesystems (NTFS, exFAT)

3 participants