]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
NVMEdevice: fix the unrelease segs issue 12862/head
authoroptimistyzy <optimistyzy@gmail.com>
Tue, 10 Jan 2017 13:01:59 +0000 (21:01 +0800)
committeroptimistyzy <optimistyzy@gmail.com>
Tue, 10 Jan 2017 13:14:18 +0000 (21:14 +0800)
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>
src/os/bluestore/NVMEDevice.cc

index 2413d63f3609527bc0a4086e4562719747c718d4..380526470503ef3113e254be27c7e599678a0cda 100644 (file)
@@ -444,6 +444,7 @@ void SharedDriverData::_aio_thread()
             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 {
@@ -460,6 +461,7 @@ void SharedDriverData::_aio_thread()
           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 {