diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index 97d9adb0bf96..49b3a2231820 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -204,6 +204,11 @@ static const char *read_super(struct cache_sb *sb, struct block_device *bdev, if (memcmp(sb->magic, bcache_magic, 16)) goto err; + + err = "Too many journal buckets"; + if (sb->keys > SB_JOURNAL_BUCKETS) + goto err; + err = "Bad checksum"; if (s->csum != csum_set(s)) goto err;