]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: cls_user_set_buckets_info can update bucket id
authorCasey Bodley <cbodley@redhat.com>
Mon, 15 Oct 2018 20:38:31 +0000 (16:38 -0400)
committerNathan Cutler <ncutler@suse.com>
Sat, 3 Nov 2018 14:22:36 +0000 (15:22 +0100)
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 d350a7a1292bb170f0280b125cfce77e827280f7..6fc34b976918a8c23006313554cea7bc0143c6e3 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) {