@@ -930,9 +930,9 @@ int RGWOrphanSearch::finish()
930930
931931int RGWRadosList::handle_stat_result (const DoutPrefixProvider *dpp,
932932 RGWRados::Object::Stat::Result& result,
933- std::string& bucket_name,
934- rgw_obj_key& obj_key,
935- std::set<string>& obj_oids)
933+ const std::string& bucket_name,
934+ const rgw_obj_key& obj_key,
935+ std::set<string>& obj_oids)
936936{
937937 obj_oids.clear ();
938938
@@ -956,9 +956,6 @@ int RGWRadosList::handle_stat_result(const DoutPrefixProvider *dpp,
956956 return 0 ;
957957 }
958958
959- bucket_name = bucket.name ;
960- obj_key = result.obj .key ;
961-
962959 if (!result.manifest ) {
963960 /* a very very old object, or part of a multipart upload during upload */
964961 obj_oids.insert (oid);
@@ -1060,22 +1057,21 @@ int RGWRadosList::pop_and_handle_stat_op(
10601057 RGWObjectCtx& obj_ctx,
10611058 std::deque<RGWRados::Object::Stat>& ops)
10621059{
1063- std::string bucket_name;
1064- rgw_obj_key obj_key;
10651060 std::set<std::string> obj_oids;
10661061 RGWRados::Object::Stat& front_op = ops.front ();
10671062
10681063 int ret = front_op.wait (dpp);
1064+ // note: even if we get an error, front_op.result.obj will still be
1065+ // populated with correct data
1066+ const std::string bucket_name = front_op.result .obj .bucket .name ;
1067+ const rgw_obj_key obj_key = front_op.result .obj .key ;
1068+
10691069 if (ret == -ENOENT) {
10701070 const auto & result = front_op.result ;
10711071 const rgw_bucket& bucket = result.obj .bucket ;
10721072 const std::string oid = bucket.marker + " _" + result.obj .get_oid ();
10731073 obj_oids.insert (oid);
10741074
1075- // needed for the processing below
1076- bucket_name = result.obj .bucket .name ;
1077- obj_key = result.obj .key ;
1078-
10791075 ldpp_dout (dpp, -1 ) << " ERROR: " << __func__ <<
10801076 " : stat of head object resulted in ENOENT; oid=" << oid << dendl;
10811077 } else if (ret < 0 ) {
0 commit comments