From 077f1d3ee8bad76094b4db38e9afbf4d456d7e4f Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sun, 31 Aug 2014 14:34:21 -0700 Subject: bcache: add assertion to catch bkeys becoming too big Signed-off-by: Kent Overstreet --- drivers/md/bcache/extents.h | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/md/bcache/extents.h b/drivers/md/bcache/extents.h index e4bb64accc6b..9a7f312a555c 100644 --- a/drivers/md/bcache/extents.h +++ b/drivers/md/bcache/extents.h @@ -35,6 +35,7 @@ static inline unsigned bch_extent_ptrs(const struct bkey *k) static inline void bch_set_extent_ptrs(struct bkey *k, unsigned i) { + BUG_ON(i > BKEY_EXTENT_PTRS_MAX); bch_set_val_u64s(k, i); } -- cgit v1.2.3