On-disk format change beckons for brave early adopters of Bcachefs

New versions of both Overstreet's baby and OpenZFS will hit the street soon

New versions of the two leading next-generations filesystems are coming: both OpenZFS 2.2.3, and some time afterwards, an improved bcachefs.

Kernel 6.7 only appeared last month and as we wrote at the time, it finally included the next-gen bcachefs filesystem. We say finally because it didn't make it into 2023's kernel 6.5, just as it didn't make it in 2022 when we looked at its features and what it promised to deliver.

Well, now, Torvalds and his army of techie termites are labouring away on kernel 6.8, and lead developer Kent Overstreet just submitted a revised bcachefs which makes some improvements to the version in 6.7. The patch notes in the link describe what this version changes, focussing on how it handles disk space accounting. It notes that the old way was simple and fast, but "limited," noting "lack of scalability", and that it was "a pain to extend." There's some more information about this in the official project roadmap.

In the new version of bcachefs, free space counts are moved into BTREE_ID_accounting keys in the B-tree data structure that gave the "B" in the project's name. (If you don't follow the Wikipedia explanation, we don't blame you at all: it's a complex subject, as this request for a simpler explanation demonstrates.)

This improvement does come with a significant cost, though:

this is in no way compatible with the old disk accounting on-disk format, and it's not feasible to write out accounting in the old format.

One of the changes modifies bcachefs's own fsck tool, so that it will convert the old disk-space accounting structures to the new ones when the volume is mounted. This should be a one-time operation, and happen the first time that a volume with the old format is mounted by a newer version of the filesystem. Such are the costs of using a very new disk storage subsystem. We suspect that it will be worth it in the long run.

Due to the extent of the changes, it's possible that they won't make it into the forthcoming 6.8 release, and might have to wait for kernel 6.9.

OpenZFS gets updated too

There is also a new release of OpenZFS, the Solaris-derived next-generation filesystem used in FreeBSD and some Linux distros. Since we covered OpenZFS 2.2 back in August, a serious – if very unlikely – data-destroying bug was uncovered in late November, and fixed in two point-releases the following month.

The OpenZFS project now arguably needs to win some confidence back, and the newly-released version 2.2.3 doesn't have any large, scary changes, just lots of bug fixes, which look nicely innocuous. About a dozen of these refer to the ZFS Test Suite, known as ZTS, which presumably reflects the amount of testing that's been done since the problems at the end of 2023.

This release is compatible with Linux kernels from 3.10 (released in mid-2013) all the way up to the current 6.7, and also has some preliminary compatibility with the still-work-in-progress kernel 6.8. Given the timing, we suspect this version will be included in Ubuntu 24.04. OpenZFS 2.2.3 also works with FreeBSD back to 12.2, released in October 2020, up to the current FreeBSD 14.

Bootnote: Is counting free space so hard?

It may not sound difficult, but keeping track of free space is not a trivial task on a modern storage subsystem, which juggles multiple drives of different sizes and speeds, takes and manages snapshots of the contents, and selectively compresses some of that storage.

This is a key weakness of principal rival Btrfs. That's especially important because if a Btrfs volume fills up with snapshots, which is easily done, writing to it is almost certain to corrupt it, and the repair tools are risky, as the warnings in the official docs and Btrfs advocate SUSE's docs show. The Reg FOSS desk has lost his entire OS to corrupted Btrfs partitions several times, and remains extremely wary of it as a result. As such, we feel confident that the bcachefs slogan "The COW filesystem for Linux that won't eat your data" is a poke at Btrfs. ®

More about


Send us news

Other stories you might like