]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: allocate enough space for bucket instance id
authorYehuda Sadeh <yehuda@inktank.com>
Mon, 16 Jun 2014 18:48:24 +0000 (11:48 -0700)
committerSage Weil <sage@inktank.com>
Thu, 26 Jun 2014 23:06:35 +0000 (16:06 -0700)
Fixes: #8608
Backport: dumpling, firefly
Bucket instance id is a concatenation of zone name, rados instance id,
and a running counter. We need to allocate enough space to account zone
name length.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit d2e86a66ca55685e04ffbfaa58452af59f381277)

src/rgw/rgw_rados.cc

index 20602d5fdaf0f05923c59439feb8ee2e6b34c4eb..61b23dafb0a956558cdcd07ca5c5c53e904afae1 100644 (file)
@@ -2345,7 +2345,7 @@ int RGWRados::create_bucket(RGWUserInfo& owner, rgw_bucket& bucket,
     if (!pmaster_bucket) {
       uint64_t iid = instance_id();
       uint64_t bid = next_bucket_id();
-      char buf[32];
+      char buf[zone.name.size() + 48];
       snprintf(buf, sizeof(buf), "%s.%llu.%llu", zone.name.c_str(), (long long)iid, (long long)bid);
       bucket.marker = buf;
       bucket.bucket_id = bucket.marker;