]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: build_linked_oids_for_bucket and build_buckets_instance_index 32820/head
authorzhangshaowen <zhangshaowen@cmss.chinamobile.com>
Mon, 4 Nov 2019 03:06:56 +0000 (11:06 +0800)
committerNathan Cutler <ncutler@suse.com>
Fri, 24 Jan 2020 14:20:09 +0000 (15:20 +0100)
should return negative value if it fails

Fixes: https://tracker.ceph.com/issues/43452
Signed-off-by: zhangshaowen <zhangshaowen@cmss.chinamobile.com>
(cherry picked from commit e9e6a3664efeda9abb4ad784b98975c272667844)

src/rgw/rgw_orphan.cc

index 567bb93b4fd2eee160890b38d10077468cb6a640..fc6fd84abd779681b5baf0829d72a290aa70d2ca 100644 (file)
@@ -375,7 +375,7 @@ int RGWOrphanSearch::build_buckets_instance_index()
   int ret = store->meta_mgr->list_keys_init(section, &handle);
   if (ret < 0) {
     lderr(store->ctx()) << "ERROR: can't get key: " << cpp_strerror(-ret) << dendl;
-    return -ret;
+    return ret;
   }
 
   map<int, list<string> > instances;
@@ -392,7 +392,7 @@ int RGWOrphanSearch::build_buckets_instance_index()
     ret = store->meta_mgr->list_keys_next(handle, max, keys, &truncated);
     if (ret < 0) {
       lderr(store->ctx()) << "ERROR: lists_keys_next(): " << cpp_strerror(-ret) << dendl;
-      return -ret;
+      return ret;
     }
 
     for (list<string>::iterator iter = keys.begin(); iter != keys.end(); ++iter) {
@@ -556,7 +556,7 @@ int RGWOrphanSearch::build_linked_oids_for_bucket(const string& bucket_instance_
                                &result, nullptr, &truncated);
     if (ret < 0) {
       cerr << "ERROR: store->list_objects(): " << cpp_strerror(-ret) << std::endl;
-      return -ret;
+      return ret;
     }
 
     for (vector<rgw_bucket_dir_entry>::iterator iter = result.begin(); iter != result.end(); ++iter) {