We only want to wake up if we are at the front of the line, in order to
preserve journal submission pipeline ordering.
This fixes, among other things, messages in the log like
2010-12-21 10:38:42.515974
7f0861486700 journal op_submit_finish 5364 expected 5370, OUT OF ORDER
and bug #666.
Signed-off-by: Sage Weil <sage@newdream.net>
Cond cond;
ops_apply_blocked.push_back(&cond);
dout(10) << "op_apply_start " << op << " blocked (getting in back of line)" << dendl;
- while (blocked)
+ while (blocked && ops_apply_blocked.front() != &cond)
cond.Wait(journal_lock);
dout(10) << "op_apply_start " << op << " woke (at front of line)" << dendl;
ops_apply_blocked.pop_front();