diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-07-21 20:23:50 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:09:09 +0300 |
commit | 382005442674a327e7238d6dc8c16071bfc723f3 (patch) | |
tree | ee99b6236bc2384baec8a8b5c37580da6b72a7f4 /fs/bcachefs/fsck.c | |
parent | b97bbd4ec35d5359398513d381345765cd80c012 (diff) | |
download | linux-382005442674a327e7238d6dc8c16071bfc723f3.tar.xz |
bcachefs: Don't squash return code in check_dirents()
We were squashing BCH_FSCK_ERRORS_NOT_FIXED.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/fsck.c')
-rw-r--r-- | fs/bcachefs/fsck.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/fs/bcachefs/fsck.c b/fs/bcachefs/fsck.c index bedfd34803ce..63d42542c194 100644 --- a/fs/bcachefs/fsck.c +++ b/fs/bcachefs/fsck.c @@ -727,7 +727,7 @@ static int check_dirent(struct btree_trans *trans, struct btree_iter *iter, k = bch2_btree_iter_peek(iter); if (!k.k) - return 1; + return 0; ret = bkey_err(k); if (ret) @@ -904,19 +904,12 @@ static int check_dirents(struct bch_fs *c) BTREE_ITER_INTENT| BTREE_ITER_PREFETCH); - while (1) { + do { ret = lockrestart_do(&trans, check_dirent(&trans, iter, &hash_info, &w, &nr_subdirs)); - if (ret == 1) { - /* at end */ - ret = 0; - break; - } if (ret) break; - - bch2_btree_iter_advance(iter); - } + } while (bch2_btree_iter_advance(iter)); bch2_trans_iter_put(&trans, iter); return bch2_trans_exit(&trans) ?: ret; |