-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Saving to exFAT partition (Linux) causes "Bad address (os error 14). Please try again." #21595
Comments
To be clear, this is not a regular exFAT FS with the mount handled by the kernel, right? It's a FUSE filesystem implemented ontop of exFAT I think I wonder if the issue is because most FUSE filesystems do not support inotify. Perhaps related: |
PS:
PS2 extra verified for/with veracrypt
|
Exfat kernel module appears to puke if you try and write an empty file.
Output
Zed might be able to work around this, but this is definitely an upstream bug and not anything Zed-specific (even if VSCode and other tools work with Exfat). Links: |
great find, sorry I didn't go deeper to eliminate the zed's fault. still it's happening in zed with every save, not only of an empty file. other editors if spitting an error while creating a new file, manage to save a non empty file w/o extra errors. |
I haven't dug further into our fs implementation to confirm, but my guess is that if you peeled back the onion you'd find that we first write 0 bytes to create the file (if not existent) and then write write the file in chunks. Perhaps this could be modified to avoid the len=0 writes. Thank you for filing the upstream issue. |
Line 536 in ccf2a60
seems like a temp file being created every time to do an atomic replace with a new version of the file? Would explain the error on every save. how about specifying a custom temp/cache dir for those operations? the alternative to write a full file w/o creating an empty file (or rather a temp file) could lead to data corruption during the write? personally i got an impression it's not really a exfat bug but rather not existing feature. Touch'ing a file on exfat doesn't intrinsically throw any errors. 👀 |
I think this would conceivably work. It might also be helpful for other non-compliant filesystems (e.g. random FUSE drivers, etc).
No. It's definitely a bug. The exFAT implementation of write is not POSIX compliant because cannot handle calls where the number of bytes
|
The exfat was never posix compliant, because of many things included but not limited to permissions and symlinks. Line 517 in ccf2a60
|
Further tests in a simple app https://github.com/maxwowpow/test_rust_fs_atomic |
Check for existing issues
Describe the bug / provide steps to reproduce it
Linux/Fedora: have an exFAT mounted partition.
Try save a file there with zed (new/edit - doesn't matter).
Expected: file saved.
Happens: file saved, but additionally an error "Bad address (os error 14). Please try again." shown.
Notes:
Ideas: which api called to save a file? trying to write any ACL on exfat?
Environment
6.11.10-300.fc41.x86_64
It happens on MacOS 15.1 APFS too (not exFAT) but I'll validate later, that it's "os error 14" code too.If applicable, add mockups / screenshots to help explain present your vision of the feature
No response
If applicable, attach your Zed.log file to this issue.
Zed.log
The text was updated successfully, but these errors were encountered: