]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: RGWCoroutine::drain_children() checks errors on last stack 39182/head
authorCasey Bodley <cbodley@redhat.com>
Fri, 29 Jan 2021 22:12:18 +0000 (17:12 -0500)
committerCasey Bodley <cbodley@redhat.com>
Fri, 29 Jan 2021 22:31:01 +0000 (17:31 -0500)
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 <cbodley@redhat.com>
src/rgw/rgw_coroutine.cc

index ce08bdd30cb8505bbdf04718e7bfcdb295ef5976..6278d695147b90fabef2a935ca1d30f2d36ffee5 100644 (file)
@@ -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;
   }