Skip to content

Commit 39ebd74

Browse files
author
Kent Overstreet
committed
bcachefs: Fix null ptr deref in invalidate_one_bucket()
bch2_backpointer_get_key() returns bkey_s_c_null when the target isn't found. backpointer_get_key() flags the error, so there's nothing else to do here - just skip it and move on. Link: koverstreet/bcachefs#847 Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
1 parent 83d539b commit 39ebd74

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/bcachefs/alloc_background.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2084,6 +2084,9 @@ static int invalidate_one_bp(struct btree_trans *trans,
20842084
if (ret)
20852085
return ret;
20862086

2087+
if (!extent_k.k)
2088+
return 0;
2089+
20872090
struct bkey_i *n =
20882091
bch2_bkey_make_mut(trans, &extent_iter, &extent_k,
20892092
BTREE_UPDATE_internal_snapshot_node);

0 commit comments

Comments
 (0)