Skip to content

Commit 3e5ceaa

Browse files
author
Kent Overstreet
committed
bcachefs: fsck: check_directory_structure runs in reverse order
When we find a directory connectivity problem, we should do the repair in the oldest snapshot that has the issue - so that we don't end up duplicating work or making a real mess of things. Oldest snapshot IDs have the highest integer value, so - just walk inodes in reverse order. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
1 parent 9fb09ac commit 3e5ceaa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/bcachefs/fsck.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2841,7 +2841,7 @@ static int check_path_loop(struct btree_trans *trans, struct bkey_s_c inode_k)
28412841
int bch2_check_directory_structure(struct bch_fs *c)
28422842
{
28432843
int ret = bch2_trans_run(c,
2844-
for_each_btree_key_commit(trans, iter, BTREE_ID_inodes, POS_MIN,
2844+
for_each_btree_key_reverse_commit(trans, iter, BTREE_ID_inodes, POS_MIN,
28452845
BTREE_ITER_intent|
28462846
BTREE_ITER_prefetch|
28472847
BTREE_ITER_all_snapshots, k,

0 commit comments

Comments
 (0)