Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: vijayi@attalasystems.com (Vijay Immanuel)
Subject: [PATCH] nvmet: release the sq ref on rdma read errors
Date: Wed, 3 May 2017 12:51:42 -0700	[thread overview]
Message-ID: <01d601d2c446$b087cb90$119762b0$@attalasystems.com> (raw)
In-Reply-To: <01cb01d2c446$20cd83a0$62688ae0$@attalasystems.com>

On rdma read errors, complete the req and release the sq ref that
was taken when the req was initialized. This avoids a hang in
nvmet_sq_destroy() when the queue is being freed.

Signed-off-by: Vijay Immanuel <vijayi at attalasystems.com>
---
 drivers/nvme/target/rdma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c
index ecc4fe8..cf98f0b 100644
--- a/drivers/nvme/target/rdma.c
+++ b/drivers/nvme/target/rdma.c
@@ -567,7 +567,7 @@ static void nvmet_rdma_read_data_done(struct ib_cq *cq, struct ib_wc *wc)
        rsp->n_rdma = 0;

        if (unlikely(wc->status != IB_WC_SUCCESS)) {
-               nvmet_rdma_release_rsp(rsp);
+               nvmet_req_complete(&rsp->req, NVME_SC_DATA_XFER_ERROR);
                if (wc->status != IB_WC_WR_FLUSH_ERR) {
                        pr_info("RDMA READ for CQE 0x%p failed with status %s (%d).\n",
                                wc->wr_cqe, ib_wc_status_msg(wc->status), wc->status);
--
1.8.3.1

       reply	other threads:[~2017-05-03 19:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAN9s3O597CB9d2BoPx1gL5a7NnqhxrXYMhE==Q3E8+BoDxRFiQ@mail.gmail.com>
     [not found] ` <01cb01d2c446$20cd83a0$62688ae0$@attalasystems.com>
2017-05-03 19:51   ` Vijay Immanuel [this message]
2017-05-03 20:23     ` [PATCH] nvmet: release the sq ref on rdma read errors Sagi Grimberg
2017-05-04  5:50       ` Sagi Grimberg
2017-05-04  8:56         ` Christoph Hellwig
2017-05-04 10:46           ` Sagi Grimberg
2017-05-04 22:51             ` Vijay Immanuel
2017-05-06 20:31               ` Sagi Grimberg
2017-05-10 16:55                 ` Christoph Hellwig
2017-05-10 16:55               ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='01d601d2c446$b087cb90$119762b0$@attalasystems.com' \
    --to=vijayi@attalasystems.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox