Skip to content

Commit

Permalink
Merge pull request ceph#36866 from yison/fix-core-dump-issue-of-sync-…
Browse files Browse the repository at this point in the history
…read

blk/spdk/NVMEDevice.cc: fix a core dump issue of sync read

Reviewed-by: Kefu Chai <[email protected]>
  • Loading branch information
tchaikov authored Aug 28, 2020
2 parents e56ace7 + 3b4714b commit fb7729c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/blk/spdk/NVMEDevice.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit fb7729c

Please sign in to comment.