Skip to content

Commit e4a07d6

Browse files
committed
erasure-code: clay wrong d calculation
Fix validation logic for `d` in CLAY erasure code profiles Updated validation to ensure `d` satisfies `k + 1 <= d <= k + m - 1`. This change aligns the implementation with the documented constraints for CLAY erasure code profiles, ensuring consistent behavior and avoiding undefined scenarios. Fixes: https://tracker.ceph.com/issues/69506 Signed-off-by: Nitzan Mordechai <[email protected]>
1 parent 058003e commit e4a07d6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/erasure-code/clay/ErasureCodeClay.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,9 @@ int ErasureCodeClay::parse(ErasureCodeProfile &profile,
261261
}
262262
}
263263
}
264-
if ((d < k) || (d > k + m - 1)) {
264+
if ((d < k + 1) || (d > k + m - 1)) {
265265
*ss << "value of d " << d
266-
<< " must be within [ " << k << "," << k+m-1 << "]" << std::endl;
266+
<< " must be within [" << k + 1 << "," << k + m - 1 << "]" << std::endl;
267267
err = -EINVAL;
268268
return err;
269269
}

0 commit comments

Comments
 (0)