From: Casey Bodley Date: Wed, 8 May 2019 18:35:25 +0000 (-0400) Subject: cls/user: cls_user_set_buckets_info overwrites creation_time X-Git-Tag: v12.2.13~34^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=cac602f13bb40b65685d1aeab5cf90ca562ed461;p=ceph.git cls/user: cls_user_set_buckets_info overwrites creation_time metadata sync of a new bucket entrypoint may call rgw_link_bucket() (which in turn calls into cls user) without deleting/unlinking the previous bucket entrypoint. this prevented the new bucket entrypoint from overwriting the creation_time of the old one Fixes: http://tracker.ceph.com/issues/39635 Signed-off-by: Casey Bodley (cherry picked from commit c469e5150a3e95b547a7d05d1ae08fa88fad7159) --- diff --git a/src/cls/user/cls_user.cc b/src/cls/user/cls_user.cc index c484588752934..5c50f7a1281c1 100644 --- a/src/cls/user/cls_user.cc +++ b/src/cls/user/cls_user.cc @@ -148,6 +148,8 @@ static int cls_user_set_buckets_info(cls_method_context_t hctx, bufferlist *in, } else if (op.add) { // bucket id may have changed (ie reshard) entry.bucket.bucket_id = update_entry.bucket.bucket_id; + // creation date may have changed (ie delete/recreate bucket) + entry.creation_time = update_entry.creation_time; } if (ret < 0) {