]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ec/jerasure: save the default m=2 of reed_sol_r6_op in profile
authorYan Jun <yan.jun8@zte.com.cn>
Mon, 26 Aug 2019 10:34:50 +0000 (18:34 +0800)
committerYan Jun <yan.jun8@zte.com.cn>
Mon, 9 Sep 2019 12:00:20 +0000 (20:00 +0800)
save the default value of m to profile so that it could be dumped
in command 'ceph osd erasure-code-profile get xxx', which is more
useful and friendly to user.

Signed-off-by: Yan Jun <yan.jun8@zte.com.cn>
src/erasure-code/jerasure/ErasureCodeJerasure.cc
src/erasure-code/jerasure/ErasureCodeJerasure.h

index 1c996582d38aa07b3d96093668750c0ebb5815b2..5a732c2e6345e742995313f54f908246cad84dae 100644 (file)
@@ -239,8 +239,11 @@ int ErasureCodeJerasureReedSolomonRAID6::parse(ErasureCodeProfile &profile,
                                               ostream *ss)
 {
   int err = ErasureCodeJerasure::parse(profile, ss);
-  profile.erase("m");
-  m = 2;
+  if (m != stoi(DEFAULT_M)) {
+    *ss << "ReedSolomonRAID6: m=" << m
+        << " must be 2 for RAID6: revert to 2" << std::endl;
+    err = -EINVAL;
+  }
   if (w != 8 && w != 16 && w != 32) {
     *ss << "ReedSolomonRAID6: w=" << w
        << " must be one of {8, 16, 32} : revert to 8 " << std::endl;
index 6af798697acbaa0baa699c44d385ce3bcd380f9c..2272e0aad637b721cd5b1f5cdc9081a9ff86325b 100644 (file)
@@ -117,6 +117,7 @@ public:
     matrix(0)
   {
     DEFAULT_K = "7";
+    DEFAULT_M = "2";
     DEFAULT_W = "8";
   }
   ~ErasureCodeJerasureReedSolomonRAID6() override {