From: J. Eric Ivancich Date: Fri, 16 Nov 2018 15:47:48 +0000 (-0500) Subject: rgw: fix bug in error codes returned X-Git-Tag: v12.2.11~115^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=216c7d90e0da96bcdc7297b4db7b21c5401f3b4b;p=ceph.git rgw: fix bug in error codes returned Fixes two bugs where positive error code was returned rather than negative error code, which is the RGW norm. Signed-off-by: J. Eric Ivancich (cherry picked from commit dc0732c524c2d8fb5b423f8cce8c6cc9aa7ca44a) --- diff --git a/src/rgw/rgw_reshard.cc b/src/rgw/rgw_reshard.cc index 4188b20e3de..199bb9c89ca 100644 --- a/src/rgw/rgw_reshard.cc +++ b/src/rgw/rgw_reshard.cc @@ -300,13 +300,13 @@ static int create_new_bucket_instance(RGWRados *store, int ret = store->init_bucket_index(new_bucket_info, new_bucket_info.num_shards); if (ret < 0) { cerr << "ERROR: failed to init new bucket indexes: " << cpp_strerror(-ret) << std::endl; - return -ret; + return ret; } ret = store->put_bucket_instance_info(new_bucket_info, true, real_time(), &attrs); if (ret < 0) { cerr << "ERROR: failed to store new bucket instance info: " << cpp_strerror(-ret) << std::endl; - return -ret; + return ret; } return 0;