mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-15 15:15:47 +00:00
bcachefs: Fix another error path locking bug
btree_update_nodes_written() was leaking a btree node lock on failure to get a journal reservation. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
75923ba7ad
commit
8707ab0df2
1 changed files with 4 additions and 3 deletions
|
@ -725,7 +725,7 @@ static void btree_update_nodes_written(struct closure *cl)
|
|||
|
||||
bch2_journal_res_put(&c->journal, &res);
|
||||
bch2_journal_preres_put(&c->journal, &as->journal_preres);
|
||||
|
||||
free_update:
|
||||
/* Do btree write after dropping journal res: */
|
||||
if (b) {
|
||||
/*
|
||||
|
@ -736,8 +736,9 @@ static void btree_update_nodes_written(struct closure *cl)
|
|||
six_unlock_intent(&b->c.lock);
|
||||
}
|
||||
|
||||
btree_update_nodes_reachable(as, res.seq);
|
||||
free_update:
|
||||
if (!ret)
|
||||
btree_update_nodes_reachable(as, res.seq);
|
||||
|
||||
__bch2_btree_update_free(as);
|
||||
/*
|
||||
* for flush_held_btree_writes() waiting on updates to flush or
|
||||
|
|
Loading…
Reference in a new issue