Bcachefs Turns to Rust in Kernel as Its Out-of-Tree Saga Deepens

Bcachefs 1.38.7 will introduce Rust code to its kernel module as a soft dependency, building on the recent 1.38.6 performance release that ended its experimental phase. Kent Overstreet eyes 50% Rust coverage this year despite out-of-tree packaging hurdles tied to Rust's unstable ABI. The move tests language benefits against deployment complexity for this advanced CoW filesystem.
Bcachefs Turns to Rust in Kernel as Its Out-of-Tree Saga Deepens
Written by Sara Donnelly

Kent Overstreet didn’t wait long. Days after Bcachefs 1.38.6 landed with fresh performance gains and the formal end to its experimental label, the project’s lead outlined plans for the next version. Bcachefs 1.38.7 will mark the start of Rust code inside the in-kernel module. The shift comes as the copy-on-write filesystem operates entirely outside the mainline Linux tree.

Userspace tools already run in Rust. Safe bindings for the core btree iterator API sit ready. Now those pieces move into the DKMS module. Initial changes target performance tests and unit tests. The rest follows. Overstreet expects roughly half the codebase in Rust before year’s end. Core btree logic stands out as high-value. Better code generation alone could deliver speed. Some optimizations he wants prove impractical without stronger static checks.

The Rust Transition and Its Immediate Costs

But the path isn’t clean. Rust lacks a stable ABI. The installed rustc version must exactly match the one used to build the kernel. Rust standard library sources need installation. Bindgen CLI and certain kernel build artifacts must align too. DKMS builds become impractical for most users, Overstreet stated bluntly in his update. Phoronix reported his words: “not going to be practical.”

Distributions will handle binary kernel module packages instead. That change mirrors challenges faced by any out-of-tree Rust driver. And Bcachefs sits firmly out-of-tree. Linus Torvalds marked it “externally maintained” last year. By Linux 6.18 the code left the kernel entirely. It ships as a DKMS module for kernels 6.16 and later. The decision followed disputes over patch quality and process. The Register detailed the personality clash that pushed the filesystem aside.

Overstreet remains optimistic. He noted all major distributions he checked now enable kernel Rust support. The timing feels right. Yet the move adds friction for packagers and users who rely on easy DKMS updates. Mixed C and Rust modules require careful deployment. Testing infrastructure must evolve. So far the project uses its own ktest harness and CI dashboard at evilpiepirate.org.

Recent benchmarks of 1.38.6 showed competitive numbers. On an EPYC 9454 system the filesystem pushed 16.5 GB/sec in dbench workloads compared with 16 GB/sec for XFS. Random write IOPS hit 700,000 against XFS’s 1 million. Reconcile operations, once known as rebalance, run faster and with more parallelism. Erasure coding sees real use and appears stable. The release raised supported devices per filesystem to 255 and fixed half a dozen bugs while identifying six further performance tweaks.

Overstreet called 1.38.6 “the performance release” and offered a belated official statement that the experimental tag no longer applies. He wrote on Patreon that the userspace conversion to Rust already delivered safe interfaces for the btree transaction API and utility code. “The next release will pull these bindings into the DKMS module, and we’ll start to convert core code,” he explained. “I don’t know how long it’ll take for it to be fully Rust — e.g. converting the journal to safe Rust will be… interesting. But it should be ~50% Rust this year.”

Discussion on forums and X quickly split. Some praised the memory safety and potential for formal verification using tools like Verus. Overstreet has experimented with verification and expressed interest in dependent types. Others questioned the overhead. Rust’s evolving toolchain complicates long-term support for enterprise storage setups. One X user highlighted the exact compiler match requirement as evidence the language remains immature for mission-critical kernel work. The Lunduke Journal posted that this fact alone makes Rust a difficult choice for such systems.

Bcachefs itself carries an ambitious feature list. Checksums on all data and metadata. Snapshots, compression, encryption, replication, caching tiers. Online fsck remains a work in progress but the project ships extensive debugging tools. It scales to petabytes. The design treats the filesystem like a database built on unified b-trees. That foundation drove its original appeal even before mainline inclusion.

Yet the out-of-tree status changes the equation. Users must add external repositories for Debian, Ubuntu, Fedora or openSUSE packages. NixOS and Arch offer their own builds. Each kernel upgrade carries extra steps. Adding Rust raises the bar further. Binary packages from distributions become the expected path. Whether those packages arrive promptly depends on distro maintainers’ willingness to ship Rust-built modules tied to specific kernel builds.

Overstreet has signaled the journal code presents the toughest conversion. Locking patterns and borrow checker rules collide with its complexity. Btree code should prove more straightforward after preparatory work that eliminated goto-style error handling in favor of RAII patterns. The existing Rust bindings for btree walking already appear in the tools repository.

Critics point to Overstreet’s other projects. He collaborates with an AI system he treats as sentient and has published papers on the topic. Some forum commenters suggested this perspective raises questions about priorities. Overstreet himself warned against lazy AI-generated patches and bug reports. The technical direction stands separate from those debates. The code either works or it doesn’t.

For now the plan stays measured. Soft dependency in 1.38.7. Performance and test code first. Infrastructure work in parallel. Then bulk conversion of straightforward files. Core pieces later. The project already maintains a unified codebase between kernel and userspace. That shared foundation eases some translation effort.

Storage administrators who run Bcachefs today face a choice. Stay on proven 1.38.6 builds while the Rust transition unfolds. Or adopt early packages that pull in Rust components and accept the new packaging model. Early adopters may gain safety guarantees and speed in select paths. Others will watch deployment complexity and long-term maintainability.

The broader Linux kernel continues its own Rust integration. Subsystems add bindings. Drivers appear. But filesystems remain rare territory. Bcachefs could become the first major one written partly or eventually fully in Rust. Overstreet once hoped for mainline return, perhaps in that form. Current reality keeps the code external. The Rust experiment will test whether the language delivers the reliability gains its advocates promise inside one of the most demanding parts of the operating system.

And the clock ticks. Next release approaches. The first Rust symbols will land in the module. Packaging teams scramble. Users read release notes carefully. The filesystem that began as an extension of the kernel’s block cache code now charts its own course. Safety through language guarantees. Performance through better abstractions. Challenges through toolchain rigidity. The outcome will shape opinions on Rust in storage for years ahead.

Subscribe for Updates

DevNews Newsletter

The DevNews Email Newsletter is essential for software developers, web developers, programmers, and tech decision-makers. Perfect for professionals driving innovation and building the future of tech.

By signing up for our newsletter you agree to receive content related to ientry.com / webpronews.com and our affiliate partners. For additional information refer to our terms of service.

Notice an error?

Help us improve our content by reporting any issues you find.

Get the WebProNews newsletter delivered to your inbox

Get the free daily newsletter read by decision makers

Subscribe
Advertise with Us

Ready to get started?

Get our media kit

Advertise with Us