Skip to content

Commit

Permalink
Merge pull request ceph#60913 from myoungwon/wip-fix-null-pointer-cri…
Browse files Browse the repository at this point in the history
…mson

crimson/osd/ops_executer: prevent access to null pointers caused by gcc bug

Reviewed-by: Yingxin Cheng <[email protected]>
Reviewed-by: Samuel Just <[email protected]>
Reviewed-by: Xuehan Xu <[email protected]>
  • Loading branch information
cyx1231st authored Dec 5, 2024
2 parents 0065f9e + b5665cf commit 9039d61
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/crimson/osd/ops_executer.h
Original file line number Diff line number Diff line change
Expand Up @@ -517,14 +517,21 @@ OpsExecuter::flush_changes_n_do_ops_effects(
ceph_assert(log_rit->version == osd_op_params->at_version);
}

/*
* This works around the gcc bug causing the generated code to incorrectly
* execute unconditionally before the predicate.
*
* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101244
*/
auto clone_obc = cloning_ctx
? std::move(cloning_ctx->clone_obc)
: nullptr;
auto [_submitted, _all_completed] = co_await mut_func(
std::move(txn),
std::move(obc),
std::move(*osd_op_params),
std::move(log_entries),
cloning_ctx
? std::move(cloning_ctx->clone_obc)
: nullptr);
std::move(clone_obc));

submitted = std::move(_submitted);
all_completed = std::move(_all_completed);
Expand Down

0 comments on commit 9039d61

Please sign in to comment.