mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-03 19:26:01 -04:00
bcachefs: Handle errors in bch2_trans_mark_update()
It's not actually the case that iterators are always checked here - __bch2_trans_commit() checks for that after running triggers. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
committed by
Kent Overstreet
parent
6ad060b0eb
commit
04903131db
@@ -293,8 +293,10 @@ int bch2_alloc_read(struct bch_fs *c, struct journal_keys *journal_keys)
|
||||
{
|
||||
int ret;
|
||||
|
||||
down_read(&c->gc_lock);
|
||||
ret = bch2_btree_and_journal_walk(c, journal_keys, BTREE_ID_alloc,
|
||||
NULL, bch2_alloc_read_fn);
|
||||
up_read(&c->gc_lock);
|
||||
if (ret) {
|
||||
bch_err(c, "error reading alloc info: %i", ret);
|
||||
return ret;
|
||||
|
||||
@@ -1836,10 +1836,11 @@ int bch2_trans_mark_update(struct btree_trans *trans,
|
||||
return 0;
|
||||
|
||||
if (!btree_node_type_is_extents(iter->btree_id)) {
|
||||
/* iterators should be uptodate, shouldn't get errors here: */
|
||||
if (btree_iter_type(iter) != BTREE_ITER_CACHED) {
|
||||
old = bch2_btree_iter_peek_slot(iter);
|
||||
BUG_ON(bkey_err(old));
|
||||
ret = bkey_err(old);
|
||||
if (ret)
|
||||
return ret;
|
||||
} else {
|
||||
struct bkey_cached *ck = (void *) iter->l[0].b;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user