diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2016-10-04 02:30:38 -0800 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2017-01-18 21:40:31 -0900 |
commit | 5825611f5280ef1cdd3874c4601697f07d20d46a (patch) | |
tree | 878555aa5878e26c90341c04f987a3684fc9832a | |
parent | f2de97aa7a38a3b0d82a18c9feb3bf7a18bea518 (diff) |
bcache: fix an assertion in bch_extent_invalid()
-rw-r--r-- | drivers/md/bcache/extents.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/md/bcache/extents.c b/drivers/md/bcache/extents.c index 1f6e19867b61..e3de4463f5b4 100644 --- a/drivers/md/bcache/extents.c +++ b/drivers/md/bcache/extents.c @@ -1531,12 +1531,8 @@ static const char *bch_extent_invalid(const struct cache_set *c, case BCH_EXTENT_ENTRY_crc64: crc = entry_to_crc(entry); - reason = "checksum uncompressed size < key size"; - if (crc_uncompressed_size(crc) < e.k->size) - goto invalid; - - reason = "checksum offset > uncompressed size"; - if (crc_offset(crc) >= crc_uncompressed_size(crc)) + reason = "checksum offset + key size > uncompressed size"; + if (crc_offset(crc) + e.k->size > crc_uncompressed_size(crc)) goto invalid; size_ondisk = crc_compressed_size(crc); |