]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: use bucket creation time from bucket instance info
authorYehuda Sadeh <yehuda@redhat.com>
Wed, 11 Dec 2019 13:53:38 +0000 (05:53 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Mon, 23 Dec 2019 11:05:29 +0000 (03:05 -0800)
Fixes: https://tracker.ceph.com/issues/43255
 - when linking bucket, use creation time from bucket instance info
 - creating an already existing bucket, keep the original bucket instance info

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_bucket.cc
src/rgw/rgw_rados.cc

index 1a3b6b1a4c5562dd67c8ed7cd6fbcc7c04364501..5d1d55cde20b8d41fb1c28b10f0c7b7c268c86e2 100644 (file)
@@ -726,7 +726,7 @@ int RGWBucket::link(RGWBucketAdminOpState& op_state, optional_yield y,
   /* link to user */
   r = store->ctl()->bucket->link_bucket(user_info.user_id,
                                      bucket_info.bucket,
-                                     ceph::real_time(),
+                                     ep.creation_time,
                                      y, true, &ep_data);
   if (r < 0) {
     set_err_msg(err_msg, "failed to relink bucket");
index b3e1d824f40de4a53df060ca67fefbb5b77555ad..8ed804600fcb0b093c07675073ff7abc1708cc75 100644 (file)
@@ -2181,6 +2181,8 @@ int RGWRados::create_bucket(const RGWUserInfo& owner, rgw_bucket& bucket,
           /* continue anyway */
         }
       }
+
+      info = std::move(orig_info);
       /* ret == -EEXIST here */
     }
     return ret;