Commit 65ddf45a authored by Kent Overstreet's avatar Kent Overstreet

bcache: Fix a null ptr deref in journal replay

Signed-off-by: default avatarKent Overstreet <kmo@daterainc.com>
parent 4fa03402
...@@ -287,9 +287,13 @@ void bch_journal_mark(struct cache_set *c, struct list_head *list) ...@@ -287,9 +287,13 @@ void bch_journal_mark(struct cache_set *c, struct list_head *list)
k < bset_bkey_last(&i->j); k < bset_bkey_last(&i->j);
k = bkey_next(k)) { k = bkey_next(k)) {
unsigned j; unsigned j;
struct bucket *g;
for (j = 0; j < KEY_PTRS(k); j++) { for (j = 0; j < KEY_PTRS(k); j++) {
struct bucket *g = PTR_BUCKET(c, k, j); if (!ptr_available(c, k, j))
continue;
g = PTR_BUCKET(c, k, j);
atomic_inc(&g->pin); atomic_inc(&g->pin);
if (g->prio == BTREE_PRIO && if (g->prio == BTREE_PRIO &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment