]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: reshard add: fail correctly on a non existant bucket 24594/head
authorAbhishek Lekshmanan <abhishek@suse.com>
Mon, 15 Oct 2018 20:00:33 +0000 (22:00 +0200)
committerAbhishek Lekshmanan <abhishek@suse.com>
Mon, 15 Oct 2018 20:00:33 +0000 (22:00 +0200)
Currently the method that validates the reshard params does not fail correctly
in case of a non existant bucket causing reshard add to print an error message
but add the non existant bucket to the queue anyway. This will later be a cause
of EBUSY errors as this entry on the logshard  can never be processed.

Fixes: http://tracker.ceph.com/issues/36449
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
src/rgw/rgw_admin.cc

index 047a506248ce25b82c34d7bd42ba16e6f46ca021..9f251c72ac732477ad6edb6699bedebfd321a1df 100644 (file)
@@ -2487,7 +2487,7 @@ int check_reshard_bucket_params(RGWRados *store,
   int ret = init_bucket(tenant, bucket_name, bucket_id, bucket_info, bucket, &attrs);
   if (ret < 0) {
     cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl;
-    return -ret;
+    return ret;
   }
 
   int num_source_shards = (bucket_info.num_shards > 0 ? bucket_info.num_shards : 1);