summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2016-09-23 12:19:50 -0800
committerKent Overstreet <kent.overstreet@gmail.com>2016-09-23 12:20:33 -0800
commit40bbc456dbc1c5b08d53a82515441b0695ef83d8 (patch)
tree05a85ae24a9ca1d6a97724f333a188a23a03be20
parentb7cb7779de9609899fa53f7bab4e3cee69ac1f7e (diff)
bcache: fix ordering of index updates after unclean shutdown
the journal sequence number blacklist machinery doesn't work if we don't actually hit all the btree nodes before starting journal replay...
-rw-r--r--drivers/md/bcache/btree_gc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/md/bcache/btree_gc.c b/drivers/md/bcache/btree_gc.c
index ec05c22857fd..4db9e54b3751 100644
--- a/drivers/md/bcache/btree_gc.c
+++ b/drivers/md/bcache/btree_gc.c
@@ -844,17 +844,17 @@ static void bch_initial_gc_btree(struct cache_set *c, enum btree_id id)
struct btree_iter iter;
struct btree *b;
struct range_checks r;
- unsigned depth = id == BTREE_ID_EXTENTS ? 0 : 1;
- if (expensive_debug_checks(c))
- depth = 0;
-
- btree_node_range_checks_init(&r, depth);
+ btree_node_range_checks_init(&r, 0);
if (!c->btree_roots[id].b)
return;
- for_each_btree_node(&iter, c, id, POS_MIN, depth, b) {
+ /*
+ * We have to hit every btree node before starting journal replay, in
+ * order for the journal seq blacklist machinery to work:
+ */
+ for_each_btree_node(&iter, c, id, POS_MIN, 0, b) {
btree_node_range_checks(c, b, &r);
if (btree_node_has_ptrs(b)) {