]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
blk/spdk/NVMEDevice.cc: fix a core dump issue of sync read 36866/head
authorYuan Lu <yuan.y.lu@intel.com>
Fri, 28 Aug 2020 18:27:50 +0000 (18:27 +0000)
committerYuan Lu <yuan.y.lu@intel.com>
Fri, 28 Aug 2020 18:32:02 +0000 (18:32 +0000)
Signed-off-by: Yuan Lu <yuan.y.lu@intel.com>
src/blk/spdk/NVMEDevice.cc

index be417bbdc353b417d260d33cc06547c0b223f69c..d95214e540d63627187884b1458df9b8a1037678 100644 (file)
@@ -922,11 +922,11 @@ int NVMEDevice::read(uint64_t off, uint64_t len, bufferlist *pbl,
   bufferptr p = buffer::create_small_page_aligned(len);
   char *buf = p.c_str();
 
-  ceph_assert(ioc->nvme_task_first == nullptr);
-  ceph_assert(ioc->nvme_task_last == nullptr);
-  make_read_tasks(this, off, ioc, buf, len, &t, off, len);
+  // for sync read, need to control IOContext in itself
+  IOContext read_ioc(cct, nullptr);
+  make_read_tasks(this, off, &read_ioc, buf, len, &t, off, len);
   dout(5) << __func__ << " " << off << "~" << len << dendl;
-  aio_submit(ioc);
+  aio_submit(&read_ioc);
 
   pbl->push_back(std::move(p));
   return t.return_code;