]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
rgw: RGWCoroutine::call(nullptr) sets retcode=0 30327/head 30328/head 30329/head
authorCasey Bodley <cbodley@redhat.com>
Fri, 23 Aug 2019 17:45:04 +0000 (13:45 -0400)
committerNathan Cutler <ncutler@suse.com>
Wed, 11 Sep 2019 11:32:57 +0000 (13:32 +0200)
commit678ec2992b568f458a99d1dfdceb11cbe4c43195
treec8b7749c2bcbca077a3b739133b4421d38337414
parent31eb493f7b6a65a34d8416c175aa355f8e9c1a80
rgw: RGWCoroutine::call(nullptr) sets retcode=0

callers generally expect 'yield call(...);' to set retcode with the
result of the given coroutine. it's valid to call() a nullptr, but
that's not always clear at the call site - for example, this critical
piece of code in RGWBucketSyncSingleEntryCR::operate():

      if (sync_status == 0) {
        /* update marker */
        set_status() << "calling marker_tracker->finish(" << entry_marker << ")";
        yield call(marker_tracker->finish(entry_marker));
        sync_status = retcode;
      }

marker_tracker->finish() only returns a coroutine when it needs to flush
the marker; otherwise it returns a nullptr. as a result, 'retcode' may
not be assigned as expected by the call(), and a previous value is
mistakenly returned up the stack

Fixes: https://tracker.ceph.com/issues/41412
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 7d12a11a14c4a9c8e814b907d83dc07783e11e80)
src/rgw/rgw_coroutine.cc