From: Casey Bodley Date: Fri, 29 Jan 2021 22:12:18 +0000 (-0500) Subject: rgw: RGWCoroutine::drain_children() checks errors on last stack X-Git-Tag: v17.1.0~3060^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F39182%2Fhead;p=ceph.git rgw: RGWCoroutine::drain_children() checks errors on last stack collect() returns false when it gets to the last stack. but it always collects one result, so we need to check for errors even when it returns false Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_coroutine.cc b/src/rgw/rgw_coroutine.cc index ce08bdd30cb8..6278d695147b 100644 --- a/src/rgw/rgw_coroutine.cc +++ b/src/rgw/rgw_coroutine.cc @@ -973,7 +973,9 @@ bool RGWCoroutine::drain_children(int num_cr_left, yield wait_for_child(); int ret; uint64_t stack_id; - while (collect(&ret, skip_stack, &stack_id)) { + bool again = false; + do { + again = collect(&ret, skip_stack, &stack_id); if (ret < 0) { ldout(cct, 10) << "collect() returned ret=" << ret << dendl; /* we should have reported this error */ @@ -982,7 +984,7 @@ bool RGWCoroutine::drain_children(int num_cr_left, if (cb) { (*cb)(stack_id, ret); } - } + } while (again); } done = true; } @@ -1000,7 +1002,9 @@ bool RGWCoroutine::drain_children(int num_cr_left, yield wait_for_child(); int ret; uint64_t stack_id; - while (collect(&ret, nullptr, &stack_id)) { + bool again = false; + do { + again = collect(&ret, nullptr, &stack_id); if (ret < 0) { ldout(cct, 10) << "collect() returned ret=" << ret << dendl; /* we should have reported this error */ @@ -1014,7 +1018,7 @@ bool RGWCoroutine::drain_children(int num_cr_left, num_cr_left = 0; /* need to drain all */ } } - } + } while (again); } done = true; }