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.
翻译:本研究提出了一种为持久性内存构建崩溃安全文件系统的新方法。我们利用Rust类型状态模式可在编译时强制执行特定操作顺序的特性,提出了一种新颖的崩溃一致性机制——同步软更新,该机制将崩溃安全性归结为对文件系统元数据更新顺序的强制约束。基于此方法,我们构建了SquirrelFS文件系统,该系统具有在编译时验证的崩溃一致性保证。SquirrelFS无需独立的形式化证明,而是将正确性保证直接嵌入类型状态本身。编译SquirrelFS仅需数十秒:成功编译即表明崩溃一致性得到满足,而编译错误则为缺陷修复提供了明确指向。通过与NOVA、WineFS等前沿文件系统的对比评估,我们发现SquirrelFS在各类基准测试和应用场景中均能实现相当或更优的性能表现。