Describe the bug
Concurrent reads on one read/write handle can simultaneously observe a changed writer version, flush and reopen the reader, and call RawPtr<FuseReader>::replace without synchronization. Another task may concurrently call path or read through the same pointer.
This is Rust undefined behavior and can cause double free, use-after-free, heap corruption, or crashes.
To Reproduce
- Open one file handle for reading and writing.
- Perform a write that advances
write_ver.
- Issue concurrent reads on the same handle with multiple FUSE tasks.
- Allow both reads to enter the reopen branch.
Expected behavior
Reader state must use safe ownership. Version check, writer flush, reader reopen, installation, and version update must form a synchronized per-handle state transition.
OS Version (please complete the following information):
- Linux
- Curvine branch: current
main
- Component:
curvine-fuse/src/fs/state/backend_handle.rs
Additional context
Add deterministic single-flight reopen tests, refresh-failure tests, concurrent read/write stress tests, and read-path performance measurements.
Dependency: the stable release/handle cleanup work should land first to reduce lifecycle conflicts.
Describe the bug
Concurrent reads on one read/write handle can simultaneously observe a changed writer version, flush and reopen the reader, and call
RawPtr<FuseReader>::replacewithout synchronization. Another task may concurrently callpathorreadthrough the same pointer.This is Rust undefined behavior and can cause double free, use-after-free, heap corruption, or crashes.
To Reproduce
write_ver.Expected behavior
Reader state must use safe ownership. Version check, writer flush, reader reopen, installation, and version update must form a synchronized per-handle state transition.
OS Version (please complete the following information):
maincurvine-fuse/src/fs/state/backend_handle.rsAdditional context
Add deterministic single-flight reopen tests, refresh-failure tests, concurrent read/write stress tests, and read-path performance measurements.
Dependency: the stable release/handle cleanup work should land first to reduce lifecycle conflicts.