summaryrefslogtreecommitdiff
path: root/drivers/md/bcache/btree_update.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/bcache/btree_update.c')
-rw-r--r--drivers/md/bcache/btree_update.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/md/bcache/btree_update.c b/drivers/md/bcache/btree_update.c
index 9e7f44e014a3..a54cc5aa4ed1 100644
--- a/drivers/md/bcache/btree_update.c
+++ b/drivers/md/bcache/btree_update.c
@@ -1853,6 +1853,9 @@ int bch_btree_insert_check_key(struct btree_iter *iter,
bkey_copy(&tmp.key, check_key);
+ /* XXX rewind shouldn't be necessary... */
+ BUG_ON(bkey_cmp(iter->pos, bkey_start_pos(&check_key->k)));
+
bch_btree_iter_rewind(iter, bkey_start_pos(&check_key->k));
ret = bch_btree_insert_at(iter, &tmp.key, NULL, NULL,