From 8cac737318955fffe4551b4a713812f119a897a1 Mon Sep 17 00:00:00 2001 From: zhangshaowen Date: Mon, 4 Nov 2019 11:06:56 +0800 Subject: [PATCH] rgw: build_linked_oids_for_bucket and build_buckets_instance_index should return negative value if it fails Fixes: https://tracker.ceph.com/issues/43452 Signed-off-by: zhangshaowen (cherry picked from commit e9e6a3664efeda9abb4ad784b98975c272667844) --- src/rgw/rgw_orphan.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rgw/rgw_orphan.cc b/src/rgw/rgw_orphan.cc index 567bb93b4fd2..fc6fd84abd77 100644 --- a/src/rgw/rgw_orphan.cc +++ b/src/rgw/rgw_orphan.cc @@ -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 > 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::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::iterator iter = result.begin(); iter != result.end(); ++iter) { -- 2.47.3