mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
bcachefs: don't lose errors from iterators that have been freed
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
2a039f1ee4
commit
ece254b258
2 changed files with 5 additions and 2 deletions
|
@ -983,6 +983,7 @@ retry_all:
|
|||
}
|
||||
|
||||
if (unlikely(ret == -EIO)) {
|
||||
trans->error = true;
|
||||
iter->flags |= BTREE_ITER_ERROR;
|
||||
iter->l[iter->level].b = BTREE_ITER_NOT_END;
|
||||
goto out;
|
||||
|
@ -1943,7 +1944,7 @@ void bch2_trans_init(struct btree_trans *trans, struct bch_fs *c)
|
|||
|
||||
int bch2_trans_exit(struct btree_trans *trans)
|
||||
{
|
||||
int ret = bch2_trans_unlock(trans);
|
||||
bch2_trans_unlock(trans);
|
||||
|
||||
kfree(trans->mem);
|
||||
if (trans->used_mempool)
|
||||
|
@ -1952,5 +1953,6 @@ int bch2_trans_exit(struct btree_trans *trans)
|
|||
kfree(trans->iters);
|
||||
trans->mem = (void *) 0x1;
|
||||
trans->iters = (void *) 0x1;
|
||||
return ret;
|
||||
|
||||
return trans->error ? -EIO : 0;
|
||||
}
|
||||
|
|
|
@ -280,6 +280,7 @@ struct btree_trans {
|
|||
u8 nr_updates;
|
||||
u8 size;
|
||||
unsigned used_mempool:1;
|
||||
unsigned error:1;
|
||||
|
||||
unsigned mem_top;
|
||||
unsigned mem_bytes;
|
||||
|
|
Loading…
Add table
Reference in a new issue