linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Chao Leng <lengchao@huawei.com>
To: Sagi Grimberg <sagi@grimberg.me>,
	<linux-nvme@lists.infradead.org>, Christoph Hellwig <hch@lst.de>,
	Keith Busch <kbusch@kernel.org>,
	"Chaitanya Kulkarni" <Chaitanya.Kulkarni@wdc.com>
Subject: Re: [PATCH 2/2] nvme-rdma: Fix possible hang when failing to set io queues
Date: Tue, 16 Mar 2021 09:33:58 +0800	[thread overview]
Message-ID: <269b5028-9ef1-7f56-1334-d89f52d86d0d@huawei.com> (raw)
In-Reply-To: <20210315210427.357584-2-sagi@grimberg.me>

Reviewed-by: Chao Leng <lengchao@huawei.com>

On 2021/3/16 5:04, Sagi Grimberg wrote:
> We only setup io queues for nvme controllers, and it makes
> absolutely no sense to allow a controller (re)connect without
> any I/O queues. If we happen to fail setting the queue count
> for any reason, we should not allow this to be a successful
> reconnect as I/O has no chance in going through. Instead
> just fail and schedule another reconnect.
> 
> Reported-by: Chao Leng <lengchao@huawei.com>
> Fixes: 711023071960 ("nvme-rdma: add a NVMe over Fabrics RDMA host driver")
> Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
> ---
>   drivers/nvme/host/rdma.c | 7 +++++--
>   1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
> index 53ac4d7442ba..eb093ea5ffa1 100644
> --- a/drivers/nvme/host/rdma.c
> +++ b/drivers/nvme/host/rdma.c
> @@ -736,8 +736,11 @@ static int nvme_rdma_alloc_io_queues(struct nvme_rdma_ctrl *ctrl)
>   		return ret;
>   
>   	ctrl->ctrl.queue_count = nr_io_queues + 1;
> -	if (ctrl->ctrl.queue_count < 2)
> -		return 0;
> +	if (ctrl->ctrl.queue_count < 2) {
> +		dev_err(ctrl->ctrl.device,
> +			"unable to set any I/O queues\n");
> +		return -ENOMEM;
> +	}
>   
>   	dev_info(ctrl->ctrl.device,
>   		"creating %d I/O queues.\n", nr_io_queues);
> 

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

  reply	other threads:[~2021-03-16  1:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-15 21:04 [PATCH 1/2] nvme-tcp: Fix possible hang when failing to set io queues Sagi Grimberg
2021-03-15 21:04 ` [PATCH 2/2] nvme-rdma: " Sagi Grimberg
2021-03-16  1:33   ` Chao Leng [this message]
2021-03-18  4:35 ` [PATCH 1/2] nvme-tcp: " 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=269b5028-9ef1-7f56-1334-d89f52d86d0d@huawei.com \
    --to=lengchao@huawei.com \
    --cc=Chaitanya.Kulkarni@wdc.com \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).