]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cls/user: cls_user_set_buckets_info overwrites creation_time
authorCasey Bodley <cbodley@redhat.com>
Wed, 8 May 2019 18:35:25 +0000 (14:35 -0400)
committerNathan Cutler <ncutler@suse.com>
Thu, 14 Nov 2019 18:24:46 +0000 (19:24 +0100)
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 <cbodley@redhat.com>
(cherry picked from commit c469e5150a3e95b547a7d05d1ae08fa88fad7159)

src/cls/user/cls_user.cc

index c48458875293453c8a37e363bb68feeea8b212de..5c50f7a1281c1b4163ad871c58bc47f29f0ba87e 100644 (file)
@@ -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) {