From 713901e09a97fdb7a3c572b4028c7f8f232bc08b Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Wed, 8 May 2019 14:35:25 -0400 Subject: [PATCH] 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) --- src/cls/user/cls_user.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cls/user/cls_user.cc b/src/cls/user/cls_user.cc index 00e2e07ea89ab..28b30283131a3 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) { -- 2.39.5