]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix bug in error codes returned
authorJ. Eric Ivancich <ivancich@redhat.com>
Fri, 16 Nov 2018 15:47:48 +0000 (10:47 -0500)
committerAbhishek Lekshmanan <abhishek@suse.com>
Fri, 7 Dec 2018 14:53:45 +0000 (15:53 +0100)
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 <ivancich@redhat.com>
(cherry picked from commit dc0732c524c2d8fb5b423f8cce8c6cc9aa7ca44a)

src/rgw/rgw_reshard.cc

index 4188b20e3dedec7cc4d0241eee7362d9667f51b2..199bb9c89cab69fc396557db4a7d1bd465508d09 100644 (file)
@@ -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;