/* must be enough pages left in the RPC to hold the compressed
* data, if not, the data from disk is probably corrupt
*/
- if (compressed_pages > page_count - 1) {
- CERROR("compressed pages from disk %d don't match pages in rpc %d\n",
- compressed_pages, page_count - 1);
+ if (compressed_pages > page_count - i) {
+ CERROR("compressed pages from disk %d don't match pages in rpc %d (at %d of %d pages)\n",
+ compressed_pages, page_count - 1 - i, i, page_count);
GOTO(out, rc = -EUCLEAN);
}
CDEBUG(D_SEC, "Decompressed size %u, pages %d\n", dst_size,
decompressed_pages);
+ /* must be enough pages left in the RPC to hold the decompressed
+ * data, if not, the data from disk is probably corrupt
+ */
+ if (decompressed_pages > page_count - i) {
+ CERROR("decompressed pages from disk %d don't match pages in rpc %d (at %d of %d pages)\n",
+ decompressed_pages, page_count - 1 - i, i, page_count);
+ GOTO(out, rc = -EUCLEAN);
+ }
unmerge_chunk(pga, NULL, i, decompressed_pages, dst, dst_size,
0);