In addition to Bcachefs working on better self-healing / automatic repair capabilities, this modern copy-on-write file-system is also working on faster snapshot deletion performance. A patch series was posted this week to speed-up the deletion of snapshots though it comes with another bump to the on-disk format of the file-system.
Bcachefs lead developer Kent Overstreet posted the patch series on Friday for improving the snapshot deletion code. He explained with the patch series:
“Snapshot deletion performance has been reported to be an issue, so this patch series should address that.
The important optimization relies on the fact that if an extent/dirent/xattr exists, a version of that inode must exist in that specific snapshot. We can that to avoid a lot of scanning.
Previously only fsck relied on this, so it would spit out a warning and correct the issue in its in memory data structures if this occurred. Now, it’s turned into a proper fsck_err() with on-disk repair if detected.
We also want some additional safety with this: if snapshot deletion ever screws up and doesn’t delete all the keys it was supposed to, we want to be able to automatically repair.
So there’s a new on disk format version with an incompatible (i.e. must be expliticly enabled) feature, where we never delete snapshot keys – we just mark them as deleted.
This allows fsck to differentiate between “key for deleted snapshot, I know how to repair this” vs. “key for missing snapshot, we’re not sure what happened and someone should probably take a look”.
And snapshot deletion status is now present in sysfs, currently with btree and position in that btree. We do have per-snapshot-id accounting, so it might be possible to turn that into a proper progress indicator later.”
So faster deleting of Bcachefs snapshots but does require an incompatible on-disk format that must be enabled. Bcachefs has been working to settle down changes around its on-disk format and aimed for it to be “soft frozen” in Linux 6.15 ahead of eventually removing the experimental flag on the file-system.
These snapshot deletion patches are now under review for Bcachefs, we’ll see if they are ready to go with the upcoming v6.16 merge window.