From: Tianshan Qu Date: Wed, 21 Aug 2019 04:33:37 +0000 (+0800) Subject: rgw: fix some list buckets handle leak X-Git-Tag: v14.2.10~71^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ae2800c853dfc0dcd965cf34103672eb99238683;p=ceph.git rgw: fix some list buckets handle leak Fixes: https://tracker.ceph.com/issues/44283 Signed-off-by: Tianshan Qu (cherry picked from commit 8955ca2c0c804f6c43bb33c97bbe263bac1cc36d) Conflicts: src/rgw/rgw_bucket.cc - changed two instances of "store->ctl()->meta.mgr->" to "store->meta_mgr->" to align with nautilus usage --- diff --git a/src/rgw/rgw_bucket.cc b/src/rgw/rgw_bucket.cc index 80ba1ba354bd..0ebc650101d1 100644 --- a/src/rgw/rgw_bucket.cc +++ b/src/rgw/rgw_bucket.cc @@ -1658,6 +1658,7 @@ int RGWBucketAdminOp::info(RGWRados *store, RGWBucketAdminOpState& op_state, formatter->dump_string("bucket", bucket_name); } } + store->meta_mgr->list_keys_complete(handle); formatter->close_section(); } @@ -1814,6 +1815,11 @@ static int process_stale_instances(RGWRados *store, RGWBucketAdminOpState& op_st bool truncated; formatter->open_array_section("keys"); + auto g = make_scope_guard([&store, &handle, &formatter]() { + store->meta_mgr->list_keys_complete(handle); + formatter->close_section(); // keys + formatter->flush(cout); + }); do { list keys; @@ -1839,8 +1845,6 @@ static int process_stale_instances(RGWRados *store, RGWBucketAdminOpState& op_st } } while (truncated); - formatter->close_section(); // keys - formatter->flush(cout); return 0; }