}
if (enable) {
ErasureCodeInterfaceRef erasure_code;
- unsigned int k, m;
+ unsigned int k, m, chunk_size;
stringstream tmp;
int err = get_erasure_code(p.erasure_code_profile, &erasure_code, &tmp);
if (err == 0) {
k = erasure_code->get_data_chunk_count();
m = erasure_code->get_coding_chunk_count();
+ chunk_size = erasure_code->get_chunk_size(p.get_stripe_width());
} else {
if (ss) {
*ss << "get_erasure_code failed: " << tmp.str();
}
return -EINVAL;
}
+
+ if ((chunk_size % 4096) != 0) {
+ if (ss) {
+ *ss << "stripe_unit must be divisible by 4096 to enable ec optimizations";
+ }
+ return -EINVAL;
+ }
// Restrict the set of shards that can be a primary to the 1st data
// raw_shard (raw_shard 0) and the coding parity raw_shards because§
// the other shards (including local parity for LRC) may not have
return -EINVAL;
}
bool was_enabled = p.allows_ecoptimizations();
- int r = enable_pool_ec_optimizations(p, nullptr, enable);
+ int r = enable_pool_ec_optimizations(p, &ss, enable);
if (r != 0) {
return r;
}