All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yi Zhang <yi.zhang@redhat.com>
To: Ming Lei <ming.lei@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
	Keith Busch <kbusch@kernel.org>,
	linux-nvme@lists.infradead.org, linux-block@vger.kernel.org
Subject: Re: [PATCH 2/2] nvme: rdma/tcp: call nvme_delete_dead_ctrl for handling reconnect failure
Date: Mon, 5 Jun 2023 22:31:48 +0800	[thread overview]
Message-ID: <CAHj4cs-4gQHnp5aiekvJmb6o8qAcb6nLV61uOGFiisCzM49_dg@mail.gmail.com> (raw)
In-Reply-To: <20230530094322.258090-3-ming.lei@redhat.com>

Thanks Ming, feel free to add:
Tested-by: Yi Zhang <yi.zhang@redhat.com>

On Tue, May 30, 2023 at 5:44 PM Ming Lei <ming.lei@redhat.com> wrote:
>
> Reconnect failure has been reached after trying enough times, and controller
> is actually incapable of handling IO, so it should be marked as dead, so call
> nvme_delete_dead_ctrl() to handle the failure for avoiding the following IO
> deadlock:
>
> 1) writeback IO waits in __bio_queue_enter() because queue is frozen
> during error recovery
>
> 2) reconnect failure handler removes controller, and del_gendisk() waits
> for above writeback IO in fsync/invalidate bdev
>
> Fix the issue by calling nvme_delete_dead_ctrl() which call
> nvme_mark_namespaces_dead() before deleting disk, so the above writeback
> IO will be failed, and IO deadlock is avoided.
>
> Reported-by: Yi Zhang <yi.zhang@redhat.com>
> Signed-off-by: Ming Lei <ming.lei@redhat.com>
> ---
>  drivers/nvme/host/rdma.c | 2 +-
>  drivers/nvme/host/tcp.c  | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
> index 0eb79696fb73..cdf5855c3009 100644
> --- a/drivers/nvme/host/rdma.c
> +++ b/drivers/nvme/host/rdma.c
> @@ -1028,7 +1028,7 @@ static void nvme_rdma_reconnect_or_remove(struct nvme_rdma_ctrl *ctrl)
>                 queue_delayed_work(nvme_wq, &ctrl->reconnect_work,
>                                 ctrl->ctrl.opts->reconnect_delay * HZ);
>         } else {
> -               nvme_delete_ctrl(&ctrl->ctrl);
> +               nvme_delete_dead_ctrl(&ctrl->ctrl);
>         }
>  }
>
> diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
> index bf0230442d57..2c119bff7010 100644
> --- a/drivers/nvme/host/tcp.c
> +++ b/drivers/nvme/host/tcp.c
> @@ -2047,7 +2047,7 @@ static void nvme_tcp_reconnect_or_remove(struct nvme_ctrl *ctrl)
>                                 ctrl->opts->reconnect_delay * HZ);
>         } else {
>                 dev_info(ctrl->device, "Removing controller...\n");
> -               nvme_delete_ctrl(ctrl);
> +               nvme_delete_dead_ctrl(ctrl);
>         }
>  }
>
> --
> 2.40.1
>


-- 
Best Regards,
  Yi Zhang


      reply	other threads:[~2023-06-05 14:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-30  9:43 [PATCH 0/2] nvme: add nvme_delete_dead_ctrl for avoiding io deadlock Ming Lei
2023-05-30  9:43 ` [PATCH 1/2] nvme: add API of nvme_delete_dead_ctrl Ming Lei
2023-06-05 21:48   ` Sagi Grimberg
2023-06-06  0:51     ` Ming Lei
2023-06-06  6:28       ` Sagi Grimberg
2023-05-30  9:43 ` [PATCH 2/2] nvme: rdma/tcp: call nvme_delete_dead_ctrl for handling reconnect failure Ming Lei
2023-06-05 14:31   ` Yi Zhang [this message]

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=CAHj4cs-4gQHnp5aiekvJmb6o8qAcb6nLV61uOGFiisCzM49_dg@mail.gmail.com \
    --to=yi.zhang@redhat.com \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=ming.lei@redhat.com \
    --cc=sagi@grimberg.me \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.