From: mkogan1 Date: Thu, 18 Apr 2019 09:30:51 +0000 (-0400) Subject: rgw: fix default_placement containing "/" when storage_class is standard X-Git-Tag: v15.1.0~2685^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0b63ef8ef3b801e71ea09965a0ee8d172de4f31c;p=ceph.git rgw: fix default_placement containing "/" when storage_class is standard fixes: http://tracker.ceph.com/issues/39380 Signed-off-by: mkogan1 --- diff --git a/src/rgw/rgw_common.h b/src/rgw/rgw_common.h index 0597cba413e3..51cd22faf831 100644 --- a/src/rgw/rgw_common.h +++ b/src/rgw/rgw_common.h @@ -695,7 +695,7 @@ struct rgw_placement_rule { void encode(bufferlist& bl) const { /* no ENCODE_START/END due to backward compatibility */ - std::string s = to_str_explicit(); + std::string s = to_str(); ceph::encode(s, bl); } @@ -720,12 +720,11 @@ struct rgw_placement_rule { size_t pos = s.find("/"); if (pos == std::string::npos) { name = s; + storage_class.clear(); return; } name = s.substr(0, pos); - if (pos < s.size() - 1) { - storage_class = s.substr(pos + 1); - } + storage_class = s.substr(pos + 1); } bool standard_storage_class() const {