Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5923916pxb; Mon, 14 Feb 2022 10:48:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJxXvzrCLIRNWIQilOvNTT0nL3Y01A3Qv7jBCiFLE9jhwWZpqz79v4BJ1SeN1O1E9PTHw4tm X-Received: by 2002:a17:90a:c7cf:: with SMTP id gf15mr16389594pjb.83.1644864509919; Mon, 14 Feb 2022 10:48:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644864509; cv=none; d=google.com; s=arc-20160816; b=Vb2OkKZ0KoMTLskomenGM9oETvR1EzcgszmY2g+xmMpJfwpJxqjABZLdDPfU1GR2ua qeYcrnzhOQAzaS9wiTMA+SSEfqYBNAg44MV8Rl86nXvWhasSr41TTovmBzS+kjcyfR77 +heDm3oDDhMPg4lbZs6G8RhiNQkUzx5Gf8Vv6WMx3Y6aQAIgBRB/r162o1/KVIgsT6Pi CX/FQkZZVKPy6bqqyj3jlIfQ5zc8/qajPJk6ktZFtmfmIWb/h+NRAFUE8z0/WXxYHXns 2Ka8Z6RM0n+5q3+JqjCOk9UVD5BDAagejrMKHxuuvTa4Im9/i+0hmVXQkhBBX7e9+fRu gepw== 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=Dg/Rcltn/lJotQZH3phyWE8OrV94VNvCXQxNfO5Ib1E=; b=bwwpu50MFbpEooKAJM7e2TRMXX3VWvk92eVThEXLfqgKBPuX5kT2hWme2aM0oGdH+i b3oJLFFZH7nLQIWR9cTMb0GYbz265cArH+j4cnLpPvu8RPZCZojanVKzjDhnOPhZsuAR R+JTkVM0FT6Ufj0g7ks7vbcKz3NJLiHEm9xh8PXNhHyP7yzb+Xl/GbaKkn7F2wL+3S4r S8R3EeOU0+mTqde70ySwU64j9b/B3bpfJPrihmnGL0wH4+c7mzIi2UNEUp1JDz2sSn9P 0ymtLQD3kaAHjcITGBNI3juFD3BpXw6W/2veXB8kmbgQGSdlZHnYq0RNLxorrowN74Fp Oo8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=g5MYGB4T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id s11si11839552pjg.9.2022.02.14.10.48.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Feb 2022 10:48:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=g5MYGB4T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 05A7B75C36; Mon, 14 Feb 2022 10:48:19 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245487AbiBNJtz (ORCPT + 99 others); Mon, 14 Feb 2022 04:49:55 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:44204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344452AbiBNJrA (ORCPT ); Mon, 14 Feb 2022 04:47:00 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21A277486C; Mon, 14 Feb 2022 01:40:36 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 80DC16102D; Mon, 14 Feb 2022 09:40:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60E2FC340E9; Mon, 14 Feb 2022 09:40:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831633; bh=JoG225rAtwc4qcEMiSnLbCERLQ35xdj41ObP079Up2A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g5MYGB4T6o9wWZ6MMPuIr1LyAo/Fq4tR26kO7BpoXBk2AJ4hforeHVo0jjH43tTwk OHAkzMGF21WjW4crQVztvFFcI0PKta5D6QI3/aw35kxXUkhIg8pnpwySlM5AnqaeNI ja/Ultv/540fymEyug8Tzp0ksc6nD+Qio8+Jg0G8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sagi Grimberg , Hannes Reinecke , Christoph Hellwig Subject: [PATCH 5.10 046/116] nvme-tcp: fix bogus request completion when failing to send AER Date: Mon, 14 Feb 2022 10:25:45 +0100 Message-Id: <20220214092500.294001171@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092458.668376521@linuxfoundation.org> References: <20220214092458.668376521@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sagi Grimberg commit 63573807b27e0faf8065a28b1bbe1cbfb23c0130 upstream. AER is not backed by a real request, hence we should not incorrectly assume that when failing to send a nvme command, it is a normal request but rather check if this is an aer and if so complete the aer (similar to the normal completion path). Cc: stable@vger.kernel.org Signed-off-by: Sagi Grimberg Reviewed-by: Hannes Reinecke Signed-off-by: Christoph Hellwig Signed-off-by: Greg Kroah-Hartman --- drivers/nvme/host/tcp.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) --- a/drivers/nvme/host/tcp.c +++ b/drivers/nvme/host/tcp.c @@ -904,7 +904,15 @@ static inline void nvme_tcp_done_send_re static void nvme_tcp_fail_request(struct nvme_tcp_request *req) { - nvme_tcp_end_request(blk_mq_rq_from_pdu(req), NVME_SC_HOST_PATH_ERROR); + if (nvme_tcp_async_req(req)) { + union nvme_result res = {}; + + nvme_complete_async_event(&req->queue->ctrl->ctrl, + cpu_to_le16(NVME_SC_HOST_PATH_ERROR), &res); + } else { + nvme_tcp_end_request(blk_mq_rq_from_pdu(req), + NVME_SC_HOST_PATH_ERROR); + } } static int nvme_tcp_try_send_data(struct nvme_tcp_request *req)