Skip to content

Commit

Permalink
Merge pull request #10662: jewel: segfault in RGWOp_MDLog_Notify
Browse files Browse the repository at this point in the history
Reviewed-by: Loic Dachary <ldachary@redhat.com>
  • Loading branch information
Loic Dachary committed Aug 23, 2016
2 parents f2f874a + ce986aa commit 7cdf8aa
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/rgw/rgw_sync.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1661,8 +1661,13 @@ class RGWMetaSyncCR : public RGWCoroutine {

std::mutex mutex; //< protect access to shard_crs

// TODO: it should be enough to hold a reference on the stack only, as calling
// RGWCoroutinesStack::wakeup() doesn't refer to the RGWCoroutine if it has
// already completed
using ControlCRRef = boost::intrusive_ptr<RGWMetaSyncShardControlCR>;
map<int, ControlCRRef> shard_crs;
using StackRef = boost::intrusive_ptr<RGWCoroutinesStack>;
using RefPair = std::pair<ControlCRRef, StackRef>;
map<int, RefPair> shard_crs;

public:
RGWMetaSyncCR(RGWMetaSyncEnv *_sync_env, RGWPeriodHistory::Cursor cursor,
Expand Down Expand Up @@ -1720,8 +1725,8 @@ class RGWMetaSyncCR : public RGWCoroutine {
auto cr = new RGWMetaSyncShardControlCR(sync_env, pool, period_id,
mdlog, shard_id, marker,
std::move(period_marker));
shard_crs[shard_id] = cr;
spawn(cr, false);
auto stack = spawn(cr, false);
shard_crs[shard_id] = RefPair{cr, stack};
}
}
// wait for each shard to complete
Expand Down Expand Up @@ -1757,7 +1762,7 @@ class RGWMetaSyncCR : public RGWCoroutine {
if (iter == shard_crs.end()) {
return;
}
iter->second->wakeup();
iter->second.first->wakeup();
}
};

Expand Down

0 comments on commit 7cdf8aa

Please sign in to comment.