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: v16.2.0~173^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=823be41cec8b9b8633ab6469303266f3583e27b7;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 (cherry picked from commit 6d0f18d0e56d28451bbe379b1ee7a83ee8b70ce7) --- diff --git a/src/rgw/rgw_coroutine.cc b/src/rgw/rgw_coroutine.cc index ce08bdd30cb..6278d695147 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; }