Kent Overstreet has released version 1.33.0 of the Bcachefs file system. The release covers two packages: bcachefs-kernel-dkms, with a kernel module built using the Dynamic Kernel Module Support (DKMS) system, and bcachefs-tools, which includes a user-space utility that implements commands for creating (mkfs), mounting, recovering, and checking the file system. The packages are available for Debian, Ubuntu, Fedora, openSUSE, NixOS, and Arch Linux. The DKMS module supports Linux kernels starting from 6.16.
The new version introduces the 'reconcile' (rebalance_v2) functionality, noted as the largest change to the file system in the past two years. Unlike the previously available 'rebalance' mode, the 'reconcile' mechanism allows for rebalancing not only data (for example, replicating multiple copies across different storage devices) but also metadata in the file system (such as migrating metadata after adding an additional drive to the pool). Furthermore, reconcile can now be applied to all input/output options, not just background copy and compression operations. Changes in device options or settings are also automatically accounted for in reconcile, causing degraded data and metadata to be re-replicated immediately.
Reconcile involves separate indexes for: high-priority operations; optimizing data processing on storage devices; and for data planned for processing that cannot currently be executed (for example, due to lack of space). Support has been added for creating a file system on a single drive in dual-replication mode (replicas=2) — in this configuration, adding a second drive will automatically replicate data to the newly added disk without requiring any user actions.
Among other changes:
- The commands 'reconcile status' and 'reconcile wait' have been added. New mount options 'mount_trusts_udev' and 'writeback_timeout' have been introduced. The commands 'data rereplicate' and 'data job drop_extra_replicas' have been deprecated.
- A recovery mode 'merge_btree_nodes' has been added, which checks all nodes in btree structures that fall under merge operations.
- Code preparation for the transition to Rust has been completed. The number of goto operations used in the code has been reduced from 2500 to 600. Instead of hard-coded vectors, the DARRAY() macro has been employed, providing functionality similar to dynamic arrays in C++ and Rust. For error handling, the try() macro, borrowed from Rust, has been utilized.
- The "bcachefs fs usage" team has ensured accurate reporting of degraded data.
- The handling of counters displayed by the "bcachefs fs top" command has been reworked. Adding new counters has been simplified, and the ability to convert tracepoints into print buffers has been implemented.
- The quality of error messages has been improved, now including details about failure types (software or hardware), actions to resolve the error (such as starting a recovery process), error codes received from block devices, and missing devices. When scanning btree structures, information about the possibility of recovering problematic nodes has been provided.
- Logging has been enhanced with the ability to separately define output rate limits for different types of errors. Such limits help prevent the loss of messages about individual hardware issues amidst a large number of software error messages.
- Progress indicators have been added for all stages of recovery.
The Bcachefs project develops a file system aimed at combining the advanced features of Btrfs and ZFS with the performance, reliability, and scalability characteristic of XFS. Bcachefs supports capabilities such as multi-device support in partitions, multi-tier storage layouts (with the lower tier for frequently used data on fast SSDs and the upper tier for less demanded data from hard drives), replication (RAID 1/10), caching, transparent data compression (LZ4, gzip, and ZSTD modes), state snapshots, integrity verification via checksums, the ability to store Reed-Solomon error correction codes (RAID 5/6), and data storage in encrypted form (using ChaCha20 and Poly1305). In terms of performance, Bcachefs surpasses Btrfs and other file systems based on the Copy-on-Write mechanism, showing work speed comparable to Ext4 and XFS.
Source: opennet.ru
