diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-08-19 00:00:12 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:09:39 +0300 |
commit | 12043cf1511420ecf38f4925a0089c1ae1aa058b (patch) | |
tree | f8efa70e183e56251b51ba71aa78595f2ee34fb8 /fs/bcachefs/fsck.c | |
parent | 42590b53fef427f96fc50da4974923564e9033cd (diff) | |
download | linux-12043cf1511420ecf38f4925a0089c1ae1aa058b.tar.xz |
bcachefs: fsck: Another transaction restart handling fix
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/fsck.c')
-rw-r--r-- | fs/bcachefs/fsck.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/fs/bcachefs/fsck.c b/fs/bcachefs/fsck.c index ff10f09eee56..9f768d774ba6 100644 --- a/fs/bcachefs/fsck.c +++ b/fs/bcachefs/fsck.c @@ -728,7 +728,7 @@ static int __get_visible_inodes(struct btree_trans *trans, w->inodes.nr = 0; - for_each_btree_key(trans, iter, BTREE_ID_inodes, POS(0, inum), + for_each_btree_key_norestart(trans, iter, BTREE_ID_inodes, POS(0, inum), BTREE_ITER_ALL_SNAPSHOTS, k, ret) { u32 equiv = bch2_snapshot_equiv(c, k.k->p.snapshot); @@ -1372,13 +1372,11 @@ static int check_subdir_count(struct btree_trans *trans, struct inode_walker *w) } } fsck_err: - if (ret) { + if (ret) bch_err(c, "error from check_subdir_count(): %s", bch2_err_str(ret)); - return ret; - } - if (trans_was_restarted(trans, restart_count)) - return -BCH_ERR_transaction_restart_nested; - return 0; + if (!ret && trans_was_restarted(trans, restart_count)) + ret = -BCH_ERR_transaction_restart_nested; + return ret; } static int check_dirent_target(struct btree_trans *trans, |