]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
bcachefs: Fix check_i_sectors()
authorKent Overstreet <kent.overstreet@gmail.com>
Wed, 20 Jul 2022 21:35:57 +0000 (17:35 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:37 +0000 (17:09 -0400)
bch2_count_inode_sectors() uses for_each_btree_key() internally, which
handles lock restarts - the lockrestart_do() in check_i_sectors() is
redundant, and buggy here since the count that
bch2_count_inode_sectors() returns was interpreted as an error by
lockrestart_do().

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
fs/bcachefs/fsck.c

index 306983811c1b69d2bbe92e47dbbedd6b05d1455a..ea264421fe8f082f0e66c677d2d2f371109be794 100644 (file)
@@ -1122,8 +1122,7 @@ static int check_i_sectors(struct btree_trans *trans, struct inode_walker *w)
                if (i->inode.bi_sectors == i->count)
                        continue;
 
-               count2 = lockrestart_do(trans,
-                       bch2_count_inode_sectors(trans, w->cur_inum, i->snapshot));
+               count2 = bch2_count_inode_sectors(trans, w->cur_inum, i->snapshot);
 
                if (i->count != count2) {
                        bch_err(c, "fsck counted i_sectors wrong: got %llu should be %llu",