]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: cls_user_set_buckets_info can update bucket id 24854/head
authorCasey Bodley <cbodley@redhat.com>
Mon, 15 Oct 2018 20:38:31 +0000 (16:38 -0400)
committerCasey Bodley <cbodley@redhat.com>
Wed, 31 Oct 2018 13:32:30 +0000 (09:32 -0400)
if cls_user_set_bucket_info() finds an existing bucket entry, it does
not update its bucket id

Fixes: https://tracker.ceph.com/issues/24505
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit e1b97fc2e804d040e8aa6fc8a94e336222d1175e)

src/cls/user/cls_user.cc

index 9a9c5bd9f7ebb4324b06a3271ac937e970704c98..fa4b5816a16c1b27288a7bd70871ace939748c23 100644 (file)
@@ -145,6 +145,9 @@ static int cls_user_set_buckets_info(cls_method_context_t hctx, bufferlist *in,
      entry = update_entry;
 
      ret = 0;
+    } else if (op.add) {
+      // bucket id may have changed (ie reshard)
+      entry.bucket.bucket_id = update_entry.bucket.bucket_id;
     }
 
     if (ret < 0) {