Flushing bug? #4340
Labels
bug
Something isn't working
📦 lib-vfs
About wasmer-vfs
📦 lib-wasi
About wasmer-wasi
priority-medium
Medium priority issue
Milestone
Describe the bug
The test case is uploaded:
sync-wasm.txt
sync-c.txt
sync.c is uploaded as sync-c.txt, sync.wasm is uploaded as sync-wasm.txt.
Steps to reproduce
wasmer run --dir=./Data sync.wasm
Expected behavior
Successfully sync to the disk and prints "File data in 'Data/hello.txt' synchronized to disk successfully."
Actual behavior
wasmer sync fails and prints:
Error synchronizing file data to disk.
Additional context
We checked the wasmer source code and found that the bug could be in wasmer_wasix::fs:lib/wasix/src/fs/mod.rs.
This is because the fd_datasync method implemented in wasmer calls the flush method, which checks whether the current file descriptor has the FD_DATASYNC permission. If it does, it returns Errno::Access, causing the error in the output information. The permission check here needs to be corrected. It should be modified to return Errno::Access only if the permission is not included.
The text was updated successfully, but these errors were encountered: