From ffe7839e7cd2297a1d0e0604c865c401f31d8936 Mon Sep 17 00:00:00 2001 From: "J. Eric Ivancich" Date: Wed, 18 Mar 2020 10:34:23 -0400 Subject: [PATCH] rgw: clean up attempt loop in ordered listing Convert a while loop into a for loop to better indicate how the "attempt" lcv is managed. Signed-off-by: J. Eric Ivancich (cherry picked from commit 6ef83820564b07dbff91b3fc6909082537c0f815) --- src/rgw/rgw_rados.cc | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 0cc0bc5525471..a6d3ad67e84a8 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -2453,14 +2453,9 @@ int RGWRados::Bucket::List::list_objects_ordered( rgw_obj_index_key prev_marker; string skip_after_delim; - uint16_t attempt = 0; - while (true) { + for (uint16_t attempt = 1; /* empty */; ++attempt) { ldout(cct, 20) << "RGWRados::Bucket::List::" << __func__ << - " beginning attempt=" << ++attempt << dendl; - - // this loop is generally expected only to have a single - // iteration; the standard exit is at the bottom of the loop, but - // there's an error condition emergency exit as well + " starting attempt " << attempt << dendl; if (attempt > 1 && !(prev_marker < cur_marker)) { // we've failed to make forward progress @@ -2607,11 +2602,7 @@ int RGWRados::Bucket::List::list_objects_ordered( // few, results, return with what we have break; } - - ldout(cct, 1) << "RGWRados::Bucket::List::" << __func__ << - " INFO ordered bucket listing requires read #" << (1 + attempt) << - dendl; - } // read attempt loop + } // for (uint16_t attempt... done: if (is_truncated) -- 2.39.5