diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-07-14 12:44:10 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:09:35 +0300 |
commit | 35f1a5034d81416ca820032452bed583f78f1f5e (patch) | |
tree | a7db6c008faa62617a15897636e88437a39a713a /fs/bcachefs/fsck.c | |
parent | 49124d8a7f3bc0f2bd33ba6cdfa2e9514a74b109 (diff) | |
download | linux-35f1a5034d81416ca820032452bed583f78f1f5e.tar.xz |
bcachefs: Improve fsck for subvols/snapshots
- Bunch of refactoring, and move some code out of
bch2_snapshots_start() and into bch2_snapshots_check(), for constency
with the rest of fsck
- Interior snapshot nodes no longer point to a subvolume; this is so we
don't end up with dangling subvol references when deleting or require
scanning the full snapshots btree.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/fsck.c')
-rw-r--r-- | fs/bcachefs/fsck.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/bcachefs/fsck.c b/fs/bcachefs/fsck.c index 1cb5787f5a6c..43575d7e050e 100644 --- a/fs/bcachefs/fsck.c +++ b/fs/bcachefs/fsck.c @@ -2403,5 +2403,8 @@ int bch2_fsck_full(struct bch_fs *c) int bch2_fsck_walk_inodes_only(struct bch_fs *c) { - return check_inodes(c, false); + return bch2_fs_check_snapshots(c) ?: + bch2_fs_check_subvols(c) ?: + bch2_delete_dead_snapshots(c) ?: + check_inodes(c, false); } |