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: v15.1.0~2682^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c469e5150a3e95b547a7d05d1ae08fa88fad7159;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 --- diff --git a/src/cls/user/cls_user.cc b/src/cls/user/cls_user.cc index 10b3e46b92f4..17e394b67b10 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) {