Received: by 2002:a05:6520:4d:b0:139:a872:a4c9 with SMTP id i13csp2566356lkm; Mon, 20 Sep 2021 18:53:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwR3AzVslJLcdxi+FM3ffBrE6ZHGX+Rxm01AIkCPA0ZZleiTrLq6+dylW+zLMdndgwh6cFV X-Received: by 2002:a05:6e02:13ef:: with SMTP id w15mr19569779ilj.255.1632188874514; Mon, 20 Sep 2021 18:47:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632188874; cv=none; d=google.com; s=arc-20160816; b=zeiPTPfBactea2OGXLFEu2pageY2FLBXs61YUM4BsAero30qSrza2uLhre4fvFBkye bJFjunykuUjyXHPrzTlH53gQMpwsCWEZyQeUAi6i3GyhQK5QGoQ/78Gn4KKWUQXXQPHm sg0ClDlsXltFUQmQ7u9ArQqkd4aGboqIjoAnQI9plETr2c7ALwBH7ix2G8fSujA5KWeq HKrCN3/JfKKejwOygvRzsZoJ3I5nzQ5bE6L/bGExmKBZYbbw5op0xVOTEDzBNZIiepoB 2WhTFBhgjQ6Pvo/B/Y71y/Yi5UjXiNXEXRFIIix584GSaLhOgDEjO2ZGRqjQsLnf0JlV sReQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=S/UeYY05rLD89jgkUDZUTDr5dI1sh/64/h7Q9sNOqUY=; b=JI8DbdbRKa8OSmicmb2orrhOMFriFSeHn+3v+dpL6QS/NFnxgmvCSG0nHyv96sUrAO JHi6tflWYpme25fJdPGbQQgBhhKupPDXnCUV7LRzx7eShOpGlb/FG4ZBGfJsW2BP3biz GYkmsK03/lTI7HMdM5wAHlRYLRPMh1uLYE8PTpiRoT23u2+OiHHanHcfBKbB0z7zsfui +U/Zq5UujAMMQ5Ii+iabqiWAvaEgO6fD231H01M0GWu4SAw/5O4pXF768qUzuOHkreW1 kHED8X9Z+npOpxAo7xoAcyx1YC0SGlxraNMxCX28jUwPGrFZ307Aap7ys5LBCdHBATyS nENg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zyJrUA2Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a7si3401200ilv.9.2021.09.20.18.47.43; Mon, 20 Sep 2021 18:47:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zyJrUA2Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346488AbhITRgz (ORCPT + 99 others); Mon, 20 Sep 2021 13:36:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:36262 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351613AbhITRec (ORCPT ); Mon, 20 Sep 2021 13:34:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 238FB61527; Mon, 20 Sep 2021 17:05:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632157550; bh=iO7NCkoA0Z8ZCilKJsMYkUfxXp2UzeeJ05EuQUhobl8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zyJrUA2QMCRpfNXIO3h5CeuKEGbaBe538+rgtEPItjhSWQW8Vj3rPw21JUh33Quop Pxl8CzynoMYTU6wO8X1u3Fe7crSlSJ8+TVrUHjfKkktPUYzhPvRul13AsiRRvCYFjA L6vipBspP6hOJOroDqEYwEOj5wQT9iy/Qsnsg/b8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ruozhu Li , Sagi Grimberg , Christoph Hellwig , Sasha Levin Subject: [PATCH 4.19 043/293] nvme-rdma: dont update queue count when failing to set io queues Date: Mon, 20 Sep 2021 18:40:05 +0200 Message-Id: <20210920163934.740386071@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163933.258815435@linuxfoundation.org> References: <20210920163933.258815435@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ruozhu Li [ Upstream commit 85032874f80ba17bf187de1d14d9603bf3f582b8 ] We update ctrl->queue_count and schedule another reconnect when io queue count is zero.But we will never try to create any io queue in next reco- nnection, because ctrl->queue_count already set to zero.We will end up having an admin-only session in Live state, which is exactly what we try to avoid in the original patch. Update ctrl->queue_count after queue_count zero checking to fix it. Signed-off-by: Ruozhu Li Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Sasha Levin --- drivers/nvme/host/rdma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c index 8798274dc3ba..ffd6a7204509 100644 --- a/drivers/nvme/host/rdma.c +++ b/drivers/nvme/host/rdma.c @@ -643,13 +643,13 @@ static int nvme_rdma_alloc_io_queues(struct nvme_rdma_ctrl *ctrl) if (ret) return ret; - ctrl->ctrl.queue_count = nr_io_queues + 1; - if (ctrl->ctrl.queue_count < 2) { + if (nr_io_queues == 0) { dev_err(ctrl->ctrl.device, "unable to set any I/O queues\n"); return -ENOMEM; } + ctrl->ctrl.queue_count = nr_io_queues + 1; dev_info(ctrl->ctrl.device, "creating %d I/O queues.\n", nr_io_queues); -- 2.30.2