From: weiqiaomiao Date: Sun, 30 Jul 2017 09:48:17 +0000 (+0100) Subject: rgw: for the create_bucket api, if the input creation_time is zero, we should set... X-Git-Tag: archive/raspbian/12.2.8+dfsg1-5+rpi1~5 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=716ca35be29033eb4930a5c2a008c266d7d0c90b;p=ceph.git rgw: for the create_bucket api, if the input creation_time is zero, we should set it to 'now" Fixes: http://tracker.ceph.com/issues/16597 Signed-off-by: weiqiaomiao Gbp-Pq: Name rgw_rados-creation_time.patch --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 3f348502d..539a564a2 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -5153,10 +5153,11 @@ int RGWRados::create_bucket(RGWUserInfo& owner, rgw_bucket& bucket, info.num_shards = bucket_index_max_shards; info.bucket_index_shard_hash_type = RGWBucketInfo::MOD; info.requester_pays = false; - if (real_clock::is_zero(creation_time)) - creation_time = ceph::real_clock::now(cct); - else + if (real_clock::is_zero(creation_time)) { + info.creation_time = ceph::real_clock::now(cct); + } else { info.creation_time = creation_time; + } ret = put_linked_bucket_info(info, exclusive, ceph::real_time(), pep_objv, &attrs, true); if (ret == -EEXIST) { /* we need to reread the info and return it, caller will have a use for it */