Snapshot deletion improvements
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest8 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | bcachefs: snapshot delete progress indicatorfs/ fs/ fs/ +5 more | +121 | 0 replies | |
| 2/8 | bcachefs: Add comments for inode snapshot requirementsfs/ fs/ | +11 | 0 replies | |
| 3/8 | bcachefs: kill inode_walker_entry.snapshotfs/ | +22 | 0 replies | |
| 4/8 | bcachefs: BCH_FSCK_ERR_snapshot_key_missing_inode_snapshotfs/ fs/ | +23 | 0 replies | |
| 5/8 | bcachefs: Skip unrelated snapshot trees in snapshot deletionfs/ fs/ | +34 | 0 replies | |
| 6/8 | bcachefs: BCH_SNAPSHOT_DELETED -> BCH_SNAPSHOT_WILL_DELETEfs/ fs/ | +7 | 0 replies | |
| 7/8 | bcachefs: bcachefs_metadata_version_snapshot_deletion_v2fs/ fs/ fs/ +4 more | +116 | 0 replies | |
| 8/8 | bcachefs: delete_dead_snapshot_keys_v2()fs/ | +133 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/8] Snapshot deletion improvements
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 make use of 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.
Kent Overstreet (8):
bcachefs: snapshot delete progress indicator
bcachefs: Add comments for inode snapshot requirements
bcachefs: kill inode_walker_entry.snapshot
bcachefs: BCH_FSCK_ERR_snapshot_key_missing_inode_snapshot
bcachefs: Skip unrelated snapshot trees in snapshot deletion
bcachefs: BCH_SNAPSHOT_DELETED -> BCH_SNAPSHOT_WILL_DELETE
bcachefs: bcachefs_metadata_version_snapshot_deletion_v2
bcachefs: delete_dead_snapshot_keys_v2()
fs/bcachefs/bcachefs.h | 3 +- fs/bcachefs/bcachefs_format.h | 3 +- fs/bcachefs/fsck.c | 78 ++++--- fs/bcachefs/io_write.c | 6 + fs/bcachefs/sb-errors_format.h | 4 +- fs/bcachefs/snapshot.c | 389 +++++++++++++++++++++++++-------- fs/bcachefs/snapshot.h | 32 ++- fs/bcachefs/snapshot_format.h | 4 +- fs/bcachefs/snapshot_types.h | 56 +++++ fs/bcachefs/subvolume.c | 2 - fs/bcachefs/subvolume.h | 3 - fs/bcachefs/subvolume_types.h | 27 --- fs/bcachefs/super.c | 1 + fs/bcachefs/sysfs.c | 5 + fs/bcachefs/xattr.c | 5 + 15 files changed, 445 insertions(+), 173 deletions(-) create mode 100644 fs/bcachefs/snapshot_types.h
Signature · 1 line
2.49.0