Skip to content

Commit

Permalink
Merge pull request #46007 from cbodley/wip-49302
Browse files Browse the repository at this point in the history
rgw: RGWCoroutine::set_sleeping() checks for null stack

Reviewed-by: Or Friedmann <ofriedma@redhat.com>
  • Loading branch information
cbodley committed Apr 26, 2022
2 parents bab8b96 + 3f0f831 commit 197e9ea
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/rgw/rgw_coroutine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -143,22 +143,30 @@ RGWCoroutine::~RGWCoroutine() {

void RGWCoroutine::init_new_io(RGWIOProvider *io_provider)
{
ceph_assert(stack); // if there's no stack, io_provider won't be uninitialized
stack->init_new_io(io_provider);
}

void RGWCoroutine::set_io_blocked(bool flag) {
stack->set_io_blocked(flag);
if (stack) {
stack->set_io_blocked(flag);
}
}

void RGWCoroutine::set_sleeping(bool flag) {
stack->set_sleeping(flag);
if (stack) {
stack->set_sleeping(flag);
}
}

int RGWCoroutine::io_block(int ret, int64_t io_id) {
return io_block(ret, rgw_io_id{io_id, -1});
}

int RGWCoroutine::io_block(int ret, const rgw_io_id& io_id) {
if (!stack) {
return 0;
}
if (stack->consume_io_finish(io_id)) {
return 0;
}
Expand All @@ -168,7 +176,9 @@ int RGWCoroutine::io_block(int ret, const rgw_io_id& io_id) {
}

void RGWCoroutine::io_complete(const rgw_io_id& io_id) {
stack->io_complete(io_id);
if (stack) {
stack->io_complete(io_id);
}
}

void RGWCoroutine::StatusItem::dump(Formatter *f) const {
Expand Down

0 comments on commit 197e9ea

Please sign in to comment.