summaryrefslogtreecommitdiff
path: root/drivers/md/bcache/bkey_methods.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/bcache/bkey_methods.c')
-rw-r--r--drivers/md/bcache/bkey_methods.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/md/bcache/bkey_methods.c b/drivers/md/bcache/bkey_methods.c
index 2b37fe623dd7..44da385c9b09 100644
--- a/drivers/md/bcache/bkey_methods.c
+++ b/drivers/md/bcache/bkey_methods.c
@@ -54,7 +54,12 @@ void bkey_debugcheck(struct btree *b, struct bkey_s_c k)
BUG_ON(!k.k->u64s);
- cache_set_bug_on(bkey_cmp(k.k->p, b->key.k.p) > 0,
+ cache_set_bug_on(bkey_cmp(bkey_start_pos(k.k),
+ b->data->min_key) < 0,
+ b->c, "key before start of btree node");
+
+ cache_set_bug_on(bkey_cmp(k.k->p,
+ b->data->max_key) > 0,
b->c, "key past end of btree node");
if (bkey_invalid(b->c, type, k)) {