# Fix file rename on FUSE-based filesystems \(\#51779\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/7340835769910d362c31fff5eafa5157c4d4a63f)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 7340835769910d362c31fff5eafa5157c4d4a63f

Requested commit: 7340835769910d362c31fff5eafa5157c4d4a63f

Commit: 7340835769910d362c31fff5eafa5157c4d4a63f

Tree: 3a9d92058124ae886bf74b01158bd0a78ff893b8

Author: Om Chillure

Committer: GitHub

## Message

```
Fix file rename on FUSE-based filesystems (#51779)

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](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).
```

## Parents

- [224be87fc3086961fd1e91bba77b2d475b2ba48d](https://git.cafe/gitcafe/zed/commit/224be87fc3086961fd1e91bba77b2d475b2ba48d?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/7340835769910d362c31fff5eafa5157c4d4a63f?format=markdown)
