Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp34967pxb; Mon, 13 Sep 2021 12:12:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXcSgZ4DVQydntFdussWaSM/8PJw1vMtA+5pzJ1KT3biFnimc9aHhbywUb6gJv+7zsyo4s X-Received: by 2002:a5d:9958:: with SMTP id v24mr8915676ios.201.1631560354892; Mon, 13 Sep 2021 12:12:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631560354; cv=none; d=google.com; s=arc-20160816; b=KN0Pqme3FmpyjAdScFbFQPfICm1RwaHk5nKVY9Xf0XQdgYGSxsBc95vXKZe+XY3OJp QAa2lUIFEUkj+VFH7W/t5+Dd7Jp9/BJhMlqaq3Mc/mjoe0ySo7FzaIWwapGyVtPfsk9D +O3CgqxvCYYjKbRnOyFNRMy4CX34IXHajYX3Ofh6NgGBWyYKqz/kjAtDLhnJupIno2cu GPZrJOinsqeGsb2IRjlT+YrBQ/q2zIdRk2wwwqD+JbfeFivzwL3ff6W69EkPHCvTPZWt xh2esjhbZ9mtd3jHreIvFwv3TqeqHpZmNb5q6uIF5B8gS69DvRqt1IusqIj39nWSZ4Xm jaqA== 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=zrgiHKc1LsbGxloWpb59Sw9b3eM7nL/2SrLK0dgMq+E=; b=nVnnnq7p8edVPGww/Oh/0vaEBhRYS2SiPuNKGvfuKweMiMZsYPNVP2121Cq5tkxhr6 6sUr4VVRcrHyE2PPtJdZDVJwZLguwEO7FvmzBo5HP3QNR++JrjsdUnXOnd96dPDJydqy +qseFcF7LyYLu60xVCFkKFQsFR2ICpBYbixeJT+JD78JLbJz/AKMll/gv+J3+VhOJpsr XGRQUaheP42c8DSr4lSzKbwL2ausf80LOFviPHmBRMhHwO6ULt9I2R6N7hubgNuN7izQ 4lx88POgWeuPvsYZSlDEpM/n9L2h4KsPOtoGLUhS1tWb+c9nFU43vPJSFchKVO6tGjyO 4h5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=R3nTwWVh; 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 k1si7309877ilo.14.2021.09.13.12.12.22; Mon, 13 Sep 2021 12:12:34 -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=R3nTwWVh; 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 S241201AbhIMNbl (ORCPT + 99 others); Mon, 13 Sep 2021 09:31:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:53278 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241979AbhIMN23 (ORCPT ); Mon, 13 Sep 2021 09:28:29 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 558D761213; Mon, 13 Sep 2021 13:23:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539421; bh=AbnGdYKQC5qqiEOoKwJTjXRBceh5WyClv3tpWA0VNFs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R3nTwWVhU6Fy6L0rziYAFptbLgoF5haTW3P5E7e/ChQp8TEt3XpX0RQXgfnzyeBrM rlawJu4yz7IYRdCpDjrUyn4ItAnEe8ICd/gmFq0X/64rv9BgdEvGr74wuaI335X1fO 2qvPmFf0hFJFWqT+mF/aJsTNty4QU/KqEE1SJpQQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ruozhu Li , Christoph Hellwig , Sasha Levin Subject: [PATCH 5.10 019/236] nvme-tcp: dont update queue count when failing to set io queues Date: Mon, 13 Sep 2021 15:12:04 +0200 Message-Id: <20210913131100.981636070@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131100.316353015@linuxfoundation.org> References: <20210913131100.316353015@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 664227fde63844d69e9ec9e90a8a7801e6ff072d ] 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 Signed-off-by: Christoph Hellwig Signed-off-by: Sasha Levin --- drivers/nvme/host/tcp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c index 82b2611d39a2..5b11d8a23813 100644 --- a/drivers/nvme/host/tcp.c +++ b/drivers/nvme/host/tcp.c @@ -1755,13 +1755,13 @@ static int nvme_tcp_alloc_io_queues(struct nvme_ctrl *ctrl) if (ret) return ret; - ctrl->queue_count = nr_io_queues + 1; - if (ctrl->queue_count < 2) { + if (nr_io_queues == 0) { dev_err(ctrl->device, "unable to set any I/O queues\n"); return -ENOMEM; } + ctrl->queue_count = nr_io_queues + 1; dev_info(ctrl->device, "creating %d I/O queues.\n", nr_io_queues); -- 2.30.2