]> git-server-git.apps.pok.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)
committerCasey Bodley <cbodley@redhat.com>
Wed, 8 May 2019 20:10:49 +0000 (16:10 -0400)
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>
src/cls/user/cls_user.cc

index 10b3e46b92f4908330fa6050978b5588b6274e46..17e394b67b10a9968ddc7f1022247d4994e5c191 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) {