]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: tiering: encode standard storage_class in rule explicitly
authorYehuda Sadeh <yehuda@redhat.com>
Thu, 25 Oct 2018 22:28:57 +0000 (15:28 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 4 Jan 2019 03:00:22 +0000 (19:00 -0800)
If it's standard storage class, don't avoid encoding it,
otherwise we can't know if it was set or not.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_common.h

index 07fe1eff5b99aa592062150a2072168fcbb51cc9..15348251074979f0fe6a0829c912be8be07f8142 100644 (file)
@@ -719,7 +719,7 @@ struct rgw_placement_rule {
 
   void encode(bufferlist& bl) const {
     /* no ENCODE_START/END due to backward compatibility */
-    std::string s = to_str();
+    std::string s = to_str_explicit();
     ceph::encode(s, bl);
   }
 
@@ -733,6 +733,10 @@ struct rgw_placement_rule {
     if (standard_storage_class()) {
       return name;
     }
+    return to_str_explicit();
+  }
+
+  std::string to_str_explicit() const {
     return name + "/" + storage_class;
   }