]> git-server-git.apps.pok.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:08:40 +0000 (16:08 -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 5c55f2b6e75bf484a9e9356adde7856f52c24743..edde93b4b8ea3e1079e4808b9c43c03a08f19f89 100644 (file)
@@ -1864,7 +1864,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;