diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2019-04-17 22:49:28 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:08:20 +0300 |
commit | 94f651e2c7e2808e82673b46776f951a67da4a2d (patch) | |
tree | 18ae9ea3df4e9c5f2bfa491d3efe722e5443f5c5 /fs/bcachefs/alloc_background.c | |
parent | 201a4d4cbed532c73d83ea9ea8166f40e9faa1e1 (diff) | |
download | linux-94f651e2c7e2808e82673b46776f951a67da4a2d.tar.xz |
bcachefs: Return errors from for_each_btree_key()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/alloc_background.c')
-rw-r--r-- | fs/bcachefs/alloc_background.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c index 4a8f6fa3db1e..a6d3417ac262 100644 --- a/fs/bcachefs/alloc_background.c +++ b/fs/bcachefs/alloc_background.c @@ -273,14 +273,14 @@ int bch2_alloc_read(struct bch_fs *c, struct journal_keys *journal_keys) bch2_trans_init(&trans, c); - for_each_btree_key(&trans, iter, BTREE_ID_ALLOC, POS_MIN, 0, k) { + for_each_btree_key(&trans, iter, BTREE_ID_ALLOC, POS_MIN, 0, k, ret) bch2_alloc_read_key(c, k); - bch2_trans_cond_resched(&trans); - } - ret = bch2_trans_exit(&trans); - if (ret) + ret = bch2_trans_exit(&trans) ?: ret; + if (ret) { + bch_err(c, "error reading alloc info: %i", ret); return ret; + } for_each_journal_key(*journal_keys, j) if (j->btree_id == BTREE_ID_ALLOC) |