From: tone-zhang Date: Fri, 1 Jun 2018 04:41:33 +0000 (+0000) Subject: spdk: fix ceph-osd crash when activate SPDK X-Git-Tag: v12.2.8~55^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3b43bc270466d289437c75a0a87bf1e33d0019b8;p=ceph.git spdk: fix ceph-osd crash when activate SPDK When activate SPDK in Ceph, observe a Ceph crash. It happened in the case 1) there is a pending IOContext in NVMEDevice and 2) the lower block device has been recreated and queue_t then points to an NVMEDevice that no longer exists. This patch addresses the problem by deleting and zeroing queue_t when NVMEDevice is closed. Fixes: http://tracker.ceph.com/issues/24371 Signed-off-by: tone-zhang (cherry picked from commit e1bd985b341553876888339620b7b9e76f078e7a) --- diff --git a/src/os/bluestore/NVMEDevice.cc b/src/os/bluestore/NVMEDevice.cc index 2eb278aa0d0..d8cb4f97afb 100644 --- a/src/os/bluestore/NVMEDevice.cc +++ b/src/os/bluestore/NVMEDevice.cc @@ -928,6 +928,8 @@ void NVMEDevice::close() { dout(1) << __func__ << dendl; + delete queue_t; + queue_t = nullptr; name.clear(); driver->remove_device(this);