The tracking for flush events was accidentally dropped. This
can result in the journal being closed too early since it
might miss in-flight flush ops.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
}
}
- void AioCompletion::start_op() {
+ void AioCompletion::start_op(bool ignore_type) {
Mutex::Locker locker(lock);
assert(ictx != nullptr);
assert(!async_op.started());
- if (state == STATE_PENDING && aio_type != AIO_TYPE_FLUSH) {
+ if (state == STATE_PENDING && (ignore_type || aio_type != AIO_TYPE_FLUSH)) {
async_op.start_op(*ictx);
}
}
void finalize(ssize_t rval);
void init_time(ImageCtx *i, aio_type_t t);
- void start_op();
+ void start_op(bool ignore_type = false);
void fail(int r);
void complete();
C_AioRequest *req_comp = new C_AioRequest(m_aio_comp);
m_image_ctx.flush(req_comp);
+ // track flush op for block writes
+ m_aio_comp->start_op(true);
m_aio_comp->put();
m_image_ctx.perfcounter->inc(l_librbd_aio_flush);