From 0338d7b6fe7172bda1aa92b9c79b32cf0a6fbc78 Mon Sep 17 00:00:00 2001 From: Abhishek Lekshmanan Date: Mon, 15 Oct 2018 22:00:33 +0200 Subject: [PATCH] rgw: reshard add: fail correctly on a non existant bucket 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 (cherry picked from commit c564b348a24edf2804a8f5f0d034f388be1c5c5f) Signed-off-by: Jonathan Brielmaier --- src/rgw/rgw_admin.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index 311596b8820ad..89a2678280628 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -2458,7 +2458,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); -- 2.39.5