]> git-server-git.apps.pok.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)
committerCasey Bodley <cbodley@redhat.com>
Mon, 15 Oct 2018 20:45:13 +0000 (16:45 -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>
src/cls/user/cls_user.cc

index 2f02219fffdb126c1f7d19cac0e53c9ae56c299f..5d7416c83a98e1502bb31ebd1ae0aa4ab1b5a093 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) {