bcachefs: Fix a null ptr deref during journal replay
authorKent Overstreet <kent.overstreet@gmail.com>
Sat, 4 Apr 2020 17:54:19 +0000 (13:54 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:38 +0000 (17:08 -0400)
commit75923ba7ad56f7236ae3979577011f5220d07d50
tree6061e7532f377d4b35745612df281b2616ee260a
parent47c46c953163909944cd8ebf7e12107635fdb604
bcachefs: Fix a null ptr deref during journal replay

We were calling bch2_extent_can_insert() incorrectly; it should only be
called when the extents-to-keys pass is running because that's when we
could be splitting a compressed extent. Calling bch2_extent_can_insert()
without passing in a disk reservation was causing a null ptr deref.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/btree_update_leaf.c