summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSlava Pestov <sviatoslavpestov@gmail.com>2014-07-22 22:28:08 -0700
committerKent Overstreet <kent.overstreet@gmail.com>2017-01-18 20:21:14 -0900
commit936e33d35289ee26288a4008053ff65426627a9c (patch)
treef74d358a5c3a93b654ef40bd29a741cc11c99553
parent56700e10a08e63a9afb7694ddaad14948aac0edc (diff)
bcache: add some pr_debug()s to journal code
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
-rw-r--r--drivers/md/bcache/journal.c20
-rw-r--r--drivers/md/bcache/super.c4
2 files changed, 21 insertions, 3 deletions
diff --git a/drivers/md/bcache/journal.c b/drivers/md/bcache/journal.c
index c32c7df1ada1..8d8f24fe4d40 100644
--- a/drivers/md/bcache/journal.c
+++ b/drivers/md/bcache/journal.c
@@ -173,11 +173,17 @@ reread: left = ca->sb.bucket_size - offset;
}
list_for_each_entry_reverse(i, list, list) {
- if (j->seq == i->j.seq)
+ if (j->seq == i->j.seq) {
+ pr_debug("j->seq %llu i->j.seq %llu",
+ j->seq, i->j.seq);
goto next_set;
+ }
- if (j->seq < i->j.last_seq)
+ if (j->seq < i->j.last_seq) {
+ pr_debug("j->seq %llu i->j.seq %llu",
+ j->seq, i->j.seq);
goto next_set;
+ }
if (j->seq > i->j.seq) {
where = &i->list;
@@ -196,7 +202,9 @@ add:
ret = 1;
ja->seq[bucket_index] = j->seq;
+ pr_debug("seq %llu", j->seq);
next_set:
+ pr_debug("next");
offset += blocks * ca->sb.block_size;
len -= blocks * ca->sb.block_size;
j = ((void *) j) + blocks * block_bytes(ca);
@@ -315,6 +323,8 @@ bsearch:
ja->cur_idx = i;
ja->last_idx = ja->discard_idx = (i + 1) %
ca->sb.njournal_buckets;
+ pr_debug("cur_idx %d last_idx %d",
+ ja->cur_idx, ja->last_idx);
}
}
@@ -396,6 +406,9 @@ int bch_journal_replay(struct cache_set *c, struct list_head *list)
pr_info("journal replay done, %i keys in %i entries, seq %llu",
keys, entries, end);
err:
+ if (ret)
+ pr_err("journal replay error: %d", ret);
+
while (!list_empty(list)) {
i = list_first_entry(list, struct journal_replay, list);
list_del(&i->list);
@@ -538,6 +551,8 @@ static void journal_reclaim(struct cache_set *c)
unsigned iter;
atomic_t p;
+ pr_debug("started");
+
/*
* only supposed to be called when we're out of space/haven't started a
* new journal entry
@@ -610,6 +625,7 @@ out:
if (!journal_full(&c->journal)) {
c->journal.u64s_remaining =
journal_write_u64s_remaining(c, c->journal.cur);
+ pr_debug("done: %d", c->journal.u64s_remaining);
wake_up(&c->journal.wait);
}
}
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index 2dae43a59a09..043bc78a15db 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -1568,8 +1568,10 @@ static void run_cache_set(struct cache_set *c)
k = bch_journal_find_btree_root(c, j, id, &level);
if (!k && id == BTREE_ID_EXTENTS)
goto err;
- if (!k)
+ if (!k) {
+ pr_debug("missing btree root: %d", id);
continue;
+ }
err = "error reading btree root";
if (bch_btree_root_read(c, id, k, level))