]> 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>
Fri, 27 Jun 2014 19:55:39 +0000 (12:55 -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>
src/rgw/rgw_rados.cc

index bef9718c1236a335b19d9726934a877f78178ade..3fdb49209baea8c3f30a54f9666a93bd4fc1a9c8 100644 (file)
@@ -2381,7 +2381,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;