SquirrelFS: using the Rust compiler to check file-system crash consistency
Hayley LeBlanc, Nathan Taylor, James Bornholt, Vijay Chidambaram
TL;DR
This paper tackles crash consistency for file systems on persistent memory by combining Rust's typestate programming with a new crash mechanism called Synchronous Soft Updates (SSU). The central idea is to statically encode and enforce the correct ordering of metadata updates at compile time, avoiding heavy proofs while providing verifiable guarantees. The authors implement SquirrelFS in Rust, demonstrate compilation-based crash-consistency checks, and validate performance against state-of-the-art PM file systems, showing comparable or better results across micro- and macro-benchmarks. The work also includes Alloy-based model checking and a detailed development experience, highlighting both the benefits and limitations of a typestate-driven approach for crash safety with potential applicability beyond PM environments.
Abstract
This work introduces a new approach to building crash-safe file systems for persistent memory. We exploit the fact that Rust's typestate pattern allows compile-time enforcement of a specific order of operations. We introduce a novel crash-consistency mechanism, Synchronous Soft Updates, that boils down crash safety to enforcing ordering among updates to file-system metadata. We employ this approach to build SquirrelFS, a new file system with crash-consistency guarantees that are checked at compile time. SquirrelFS avoids the need for separate proofs, instead incorporating correctness guarantees into the typestate itself. Compiling SquirrelFS only takes tens of seconds; successful compilation indicates crash consistency, while an error provides a starting point for fixing the bug. We evaluate SquirrelFS against state of the art file systems such as NOVA and WineFS, and find that SquirrelFS achieves similar or better performance on a wide range of benchmarks and applications.
