summaryrefslogtreecommitdiff
path: root/fs/bcachefs/fsck.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-07-14 12:44:10 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:35 +0300
commit35f1a5034d81416ca820032452bed583f78f1f5e (patch)
treea7db6c008faa62617a15897636e88437a39a713a /fs/bcachefs/fsck.c
parent49124d8a7f3bc0f2bd33ba6cdfa2e9514a74b109 (diff)
downloadlinux-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.c5
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);
}