mirror of
https://github.com/torvalds/linux.git
synced 2026-06-05 13:06:59 +02:00
bcachefs: Ensure __bch2_trans_commit() always calls bch2_trans_reset()
This was leading to a very strange bug in bch2_bucket_io_time_reset(), where we'd retry without clearing out the list of updates. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
fdbb88ac01
commit
b7cf4bd7fe
|
|
@ -836,7 +836,7 @@ int __bch2_trans_commit(struct btree_trans *trans)
|
|||
int ret = 0;
|
||||
|
||||
if (!trans->nr_updates)
|
||||
goto out_noupdates;
|
||||
goto out_reset;
|
||||
|
||||
if (trans->flags & BTREE_INSERT_GC_LOCK_HELD)
|
||||
lockdep_assert_held(&trans->c->gc_lock);
|
||||
|
|
@ -850,7 +850,7 @@ int __bch2_trans_commit(struct btree_trans *trans)
|
|||
unlikely(!percpu_ref_tryget(&trans->c->writes))) {
|
||||
ret = bch2_trans_commit_get_rw_cold(trans);
|
||||
if (ret)
|
||||
return ret;
|
||||
goto out_reset;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BCACHEFS_DEBUG
|
||||
|
|
@ -962,7 +962,7 @@ int __bch2_trans_commit(struct btree_trans *trans)
|
|||
|
||||
if (likely(!(trans->flags & BTREE_INSERT_NOCHECK_RW)))
|
||||
percpu_ref_put(&trans->c->writes);
|
||||
out_noupdates:
|
||||
out_reset:
|
||||
bch2_trans_reset(trans, !ret ? TRANS_RESET_NOTRAVERSE : 0);
|
||||
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user