When the read or flush command fails, we need to
release segs. Or we can abort it like what we do
for write.
Signed-off-by: optimistyzy <optimistyzy@gmail.com>
derr << __func__ << " failed to read" << dendl;
--t->ctx->num_reading;
t->return_code = r;
+ t->release_segs();
std::unique_lock<std::mutex> l(t->ctx->lock);
t->ctx->cond.notify_all();
} else {
if (r < 0) {
derr << __func__ << " failed to flush" << dendl;
t->return_code = r;
+ t->release_segs();
std::unique_lock<std::mutex> l(t->ctx->lock);
t->ctx->cond.notify_all();
} else {