]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: print error if spdk_nvme_ns_cmd_writev() fails 31932/head
authorKefu Chai <kchai@redhat.com>
Mon, 2 Dec 2019 09:55:39 +0000 (17:55 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 2 Dec 2019 09:59:31 +0000 (17:59 +0800)
when spdk_nvme_ns_cmd_writev() func return error, it hasn't direct error
code. So it can add some error info.

Fixes: https://tracker.ceph.com/issues/41208
Signed-off-by: NancySu05 <su_nan@inspur.com>
src/os/bluestore/NVMEDevice.cc

index 107bd085bd296c291828cb7e4a7eb9102392b63d..bef0c6357605b50aed315baf5d68de1e22eba76e 100644 (file)
@@ -397,7 +397,7 @@ void SharedDriverQueueData::_aio_handle(Task *t, IOContext *ioc)
               ns, qpair, lba_off, lba_count, io_complete, t, 0,
               data_buf_reset_sgl, data_buf_next_sge);
           if (r < 0) {
-            derr << __func__ << " failed to do write command" << dendl;
+            derr << __func__ << " failed to do write command: " << cpp_strerror(r) << dendl;
             t->ctx->nvme_task_first = t->ctx->nvme_task_last = nullptr;
             t->release_segs(this);
             delete t;
@@ -421,7 +421,7 @@ void SharedDriverQueueData::_aio_handle(Task *t, IOContext *ioc)
               ns, qpair, lba_off, lba_count, io_complete, t, 0,
               data_buf_reset_sgl, data_buf_next_sge);
           if (r < 0) {
-            derr << __func__ << " failed to read" << dendl;
+            derr << __func__ << " failed to read: " << cpp_strerror(r) << dendl;
             t->release_segs(this);
             delete t;
             ceph_abort();
@@ -437,7 +437,7 @@ void SharedDriverQueueData::_aio_handle(Task *t, IOContext *ioc)
           dout(20) << __func__ << " flush command issueed " << dendl;
           r = spdk_nvme_ns_cmd_flush(ns, qpair, io_complete, t);
           if (r < 0) {
-            derr << __func__ << " failed to flush" << dendl;
+            derr << __func__ << " failed to flush: " << cpp_strerror(r) << dendl;
             t->release_segs(this);
             delete t;
             ceph_abort();