]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
erasure-code: clay wrong d calculation
authorNitzan Mordechai <nmordech@redhat.com>
Mon, 20 Jan 2025 13:30:29 +0000 (13:30 +0000)
committerNitzan Mordechai <nmordech@redhat.com>
Thu, 13 Feb 2025 10:05:08 +0000 (10:05 +0000)
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 <nmordech@redhat.com>
src/erasure-code/clay/ErasureCodeClay.cc

index ab74542a3ea73d1237561c9a73315efc001b351f..ba50fe8171cf70580c426b08f08efca6ccc31059 100644 (file)
@@ -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;
   }