diff options
author | Kent Overstreet <kmo@daterainc.com> | 2014-02-24 22:55:28 -0500 |
---|---|---|
committer | Kent Overstreet <kmo@daterainc.com> | 2014-03-17 22:01:03 -0400 |
commit | 65ddf45a3102916fb622c71f7af158b19d49dc7f (patch) | |
tree | 2750fb8191169f39c5942cfce8b86a45d7f92281 /drivers/md/bcache/journal.c | |
parent | 4fa03402cda2fac1a54248c7578b939d95931dc0 (diff) |
bcache: Fix a null ptr deref in journal replay
Signed-off-by: Kent Overstreet <kmo@daterainc.com>
Diffstat (limited to 'drivers/md/bcache/journal.c')
-rw-r--r-- | drivers/md/bcache/journal.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/md/bcache/journal.c b/drivers/md/bcache/journal.c index e38c5997bf12..97e6a92da999 100644 --- a/drivers/md/bcache/journal.c +++ b/drivers/md/bcache/journal.c | |||
@@ -287,9 +287,13 @@ void bch_journal_mark(struct cache_set *c, struct list_head *list) | |||
287 | k < bset_bkey_last(&i->j); | 287 | k < bset_bkey_last(&i->j); |
288 | k = bkey_next(k)) { | 288 | k = bkey_next(k)) { |
289 | unsigned j; | 289 | unsigned j; |
290 | struct bucket *g; | ||
290 | 291 | ||
291 | for (j = 0; j < KEY_PTRS(k); j++) { | 292 | for (j = 0; j < KEY_PTRS(k); j++) { |
292 | struct bucket *g = PTR_BUCKET(c, k, j); | 293 | if (!ptr_available(c, k, j)) |
294 | continue; | ||
295 | |||
296 | g = PTR_BUCKET(c, k, j); | ||
293 | atomic_inc(&g->pin); | 297 | atomic_inc(&g->pin); |
294 | 298 | ||
295 | if (g->prio == BTREE_PRIO && | 299 | if (g->prio == BTREE_PRIO && |