diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-02-14 04:42:12 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:09:23 +0300 |
commit | 9e34316156a2c148b0675087beeaca26f7eb79f9 (patch) | |
tree | 8399f66785e99c8ff210e436b33eacd7bb8aae2c /fs/bcachefs/fsck.c | |
parent | aa8982c3f2cbfca89fb73daad9d6e65f7be022c2 (diff) | |
download | linux-9e34316156a2c148b0675087beeaca26f7eb79f9.tar.xz |
bcachefs: Small fsck fix
The check_dirents pass handles transaction restarts at the toplevel -
check_subdir_count() was incorrectly handling transaction restarts
without returning -EINTR, meaning that the iterator pointing to the
dirent being checked was left invalid.
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, 3 insertions, 2 deletions
diff --git a/fs/bcachefs/fsck.c b/fs/bcachefs/fsck.c index 43b6159be01b..ced4d671eb8d 100644 --- a/fs/bcachefs/fsck.c +++ b/fs/bcachefs/fsck.c @@ -1316,8 +1316,9 @@ static int check_subdir_count(struct btree_trans *trans, struct inode_walker *w) if (i->inode.bi_nlink == i->count) continue; - count2 = lockrestart_do(trans, - bch2_count_subdirs(trans, w->cur_inum, i->snapshot)); + count2 = bch2_count_subdirs(trans, w->cur_inum, i->snapshot); + if (count2 < 0) + return count2; if (i->count != count2) { bch_err(c, "fsck counted subdirectories wrong: got %llu should be %llu", |