From 5ffee830f6d4eda67de20409fd0f7f1685e04026 Mon Sep 17 00:00:00 2001 From: optimistyzy Date: Tue, 10 Jan 2017 21:01:59 +0800 Subject: [PATCH] NVMEdevice: fix the unrelease segs issue 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 --- src/os/bluestore/NVMEDevice.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/os/bluestore/NVMEDevice.cc b/src/os/bluestore/NVMEDevice.cc index 2413d63f36095..380526470503e 100644 --- a/src/os/bluestore/NVMEDevice.cc +++ b/src/os/bluestore/NVMEDevice.cc @@ -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 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 l(t->ctx->lock); t->ctx->cond.notify_all(); } else { -- 2.39.5