From: Yehuda Sadeh Date: Mon, 16 Jun 2014 18:48:24 +0000 (-0700) Subject: rgw: allocate enough space for bucket instance id X-Git-Tag: v0.80.2~13^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5f66a2c99fdef2c8d609126740ca790ce10e67a4;p=ceph.git rgw: allocate enough space for bucket instance id 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 (cherry picked from commit d2e86a66ca55685e04ffbfaa58452af59f381277) --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 20602d5fdaf0..61b23dafb0a9 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -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;