rpc_chunk_bits = llch->llch_chunk_log_bits +
COMPR_CHUNK_MIN_BITS;
- /* the chunk bits in every chunk should be the same */
- LASSERT(rpc_chunk_bits == chunk_bits);
+ /* the chunk bits from storage must be the same as from
+ * the layout (but don't assert on it, since it comes
+ * from storage and could potentially be corrupted)
+ */
+ if (rpc_chunk_bits != chunk_bits) {
+ CERROR(
+ "chunk bits from storage (%d) and layout (%d) disagree\n",
+ rpc_chunk_bits, chunk_bits);
+ GOTO(out, rc = -EIO);
+ }
CDEBUG(D_SEC, "chunk_size: %i, pages_in_chunk: %i\n",
chunk_size, pages_in_chunk);