Bcachefs 1.38 Released With Faster Mounts and Discard Fixes

Bcachefs 1.38 fixes mount stalls, improves discard handling, and speeds up snapshot-heavy systems with journal and allocator changes.

Kent Overstreet has released Bcachefs 1.38, a modern copy-on-write Linux filesystem that supports encryption, snapshots, compression, and other advanced features designed to compete with filesystems such as Btrfs and ZFS.

The most important change is a redesign of the need_discard btree. Pending discard work is now indexed by journal sequence number instead of device and bucket, changing how the allocator works with the discard worker. According to the release notes, the new layout breaks the deadlock and fixes allocator-stuck-on-mount regressions reported upstream.

The redesign also improves discard performance under sustained load. Instead of rescanning the full set each pass, the discard worker can now iterate entries directly in sequence order. On write-heavy workloads, especially on larger filesystems, this should result in better discard throughput.

Another significant update in 1.38 is journal pipelining. Bcachefs was previously limited to 16 in-flight journal writes at a time, but the new release moves this to a separate FIFO with 256 entries. Upstream describes the old limit as a severe bottleneck for large arrays, making this one of the key scalability changes in the release.

Users with many snapshots should see better mount performance. Bcachefs 1.38 fixes an accidental O(n²) issue caused by incorrectly growing the in-memory snapshot table. This should result in much faster mount times on systems with many snapshots.

The bug-fix list includes several smaller corrections. bcachefs format no longer misdetects SSDs as rotational when a partition is used, an issue noted for filesystems created on partitions with 1.37.5. Plus, new filesystems created with the updated version are now handled correctly.

There is also a fix for reconcile spinning indefinitely on encrypted filesystems with nocow enabled. These options are not compatible, so encryption now falls back to COW automatically, and the interaction is documented in the man page.

Elsewhere, the release fixes bcachefs migrate failures caused by O_DIRECT alignment issues and corrects a stripe-repair path that could spin when handling a force-removed device during shrink operations.

On the tooling side, bcachefs dump sanitize now produces correct output for affected key formats, while list_journal -k correctly handles multiple ranges with per-range signs.

For more details, see the changelog.

Currently, Bcachefs tooling is officially packaged in a limited number of distributions, including Arch Linux, Gentoo, Void, and Fedora. Debian and Ubuntu do not include Bcachefs in their repositories, but users can add support through the external upstream APT repository at apt.bcachefs.org.

openSUSE provides Bcachefs through its Build Service, while NixOS includes only the userspace tools. Since Bcachefs is no longer part of the mainline kernel, all distributions rely on an out-of-tree module, typically DKMS, to enable filesystem support. Module availability may vary between systems.

Bobby Borisov

Bobby Borisov

Bobby, an editor-in-chief at Linuxiac, is a Linux professional with over 20 years of experience. With a strong focus on Linux and open-source software, he has worked as a Senior Linux System Administrator, Software Developer, and DevOps Engineer for small and large multinational companies.

Leave a Reply

Your email address will not be published. Required fields are marked *