From: Nitzan Mordechai Date: Mon, 20 Jan 2025 13:30:29 +0000 (+0000) Subject: erasure-code: clay wrong d calculation X-Git-Tag: v20.3.0~185^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e4a07d65e1f0cee330ae45e86d78f16231521b21;p=ceph.git 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 --- diff --git a/src/erasure-code/clay/ErasureCodeClay.cc b/src/erasure-code/clay/ErasureCodeClay.cc index ab74542a3ea..ba50fe8171c 100644 --- a/src/erasure-code/clay/ErasureCodeClay.cc +++ b/src/erasure-code/clay/ErasureCodeClay.cc @@ -261,9 +261,9 @@ int ErasureCodeClay::parse(ErasureCodeProfile &profile, } } } - if ((d < k) || (d > k + m - 1)) { + if ((d < k + 1) || (d > k + m - 1)) { *ss << "value of d " << d - << " must be within [ " << k << "," << k+m-1 << "]" << std::endl; + << " must be within [" << k + 1 << "," << k + m - 1 << "]" << std::endl; err = -EINVAL; return err; }