Skip to content

Commit

Permalink
bcache: Fix a bug recovering from unclean shutdown
Browse files Browse the repository at this point in the history
The code to fixup incorrect bucket prios incorrectly did not skip btree node
freeing keys

Signed-off-by: Kent Overstreet <kmo@daterainc.com>
  • Loading branch information
Kent Overstreet committed Mar 18, 2014
1 parent 27201cf commit 0bd143f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/md/bcache/btree.c
Original file line number Diff line number Diff line change
Expand Up @@ -1726,9 +1726,9 @@ static int bch_btree_check_recurse(struct btree *b, struct btree_op *op,
!ptr_stale(b->c, k, i)) {
g->gen = PTR_GEN(k, i);

if (b->level)
if (b->level && bkey_cmp(k, &ZERO_KEY))
g->prio = BTREE_PRIO;
else if (g->prio == BTREE_PRIO)
else if (!b->level && g->prio == BTREE_PRIO)
g->prio = INITIAL_PRIO;
}
}
Expand Down

0 comments on commit 0bd143f

Please sign in to comment.