bcachefs: Release transaction before wake up
PATCH 1/1 bcachefs: Release transaction before wake up
We will get this if we wake up first:
Kernel panic - not syncing: btree_node_write_done leaked btree_trans
since there are still transactions waiting for cycle detectors after BTREE_NODE_write_in_flight is cleared.
Signed-off-by Alan Huang <[email protected]>
--- fs/bcachefs/btree_io.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
fs/bcachefs/btree_io.c +3 -2
@@ -1834,10 +1834,11 @@ static void btree_node_write_done(struct bch_fs *c, struct btree *b)struct btree_trans *trans =bch2_trans_get (c);btree_node_lock_nopath_nofail (trans, &b->c, SIX_LOCK_read); -__btree_node_write_done (c, b); -six_unlock_read (&b->c.lock); +/* we don't need transaction context anymore after we got the lock. */ bch2_trans_put (trans); +__btree_node_write_done (c, b); +six_unlock_read (&b->c.lock); }static void btree_node_write_work (struct work_struct *work)
Signature · 1 line
2.45.2
Quoted 8 lines · Alan Huang
We will get this if we wake up first:
Kernel panic - not syncing: btree_node_write_done leaked btree_transsince there are still transactions waiting for cycle detectors after
BTREE_NODE_write_in_flightis cleared.Signed-off-by Alan Huang <[email protected]>
Nice - applied