Skip to content

Commit

Permalink
Merge pull request #6877 from dillaman/wip-14001
Browse files Browse the repository at this point in the history
librbd: fix test case race condition for journaling ops

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
  • Loading branch information
jdurgin committed Dec 9, 2015
2 parents 9162bd2 + 7f5ee33 commit bcd37cf
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/librbd/operation/Request.cc
Expand Up @@ -39,18 +39,19 @@ void Request<I>::send() {

template <typename I>
void Request<I>::finish(int r) {
AsyncRequest<I>::finish(r);

I &image_ctx = this->m_image_ctx;
RWLock::RLocker snap_locker(image_ctx.snap_lock);
if (m_tid != 0 &&
image_ctx.journal != NULL &&
!image_ctx.journal->is_journal_replaying()) {
// ops will be canceled / completed before closing journal
assert(image_ctx.journal->is_journal_ready());
{
I &image_ctx = this->m_image_ctx;
RWLock::RLocker snap_locker(image_ctx.snap_lock);
if (m_tid != 0 && image_ctx.journal != NULL &&
!image_ctx.journal->is_journal_replaying()) {
// ops will be canceled / completed before closing journal
assert(image_ctx.journal->is_journal_ready());

image_ctx.journal->commit_op_event(m_tid, r);
image_ctx.journal->commit_op_event(m_tid, r);
}
}

AsyncRequest<I>::finish(r);
}

template <typename I>
Expand Down

0 comments on commit bcd37cf

Please sign in to comment.