Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp6017936pxb; Mon, 14 Feb 2022 13:14:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJzecJSkBWPMeeOjtSut8g+RxIjC5YGlWqG2vYr1Ouy+sK67mekrsCa1GKbGGNcEN8vnz0rM X-Received: by 2002:a05:6a00:cc8:: with SMTP id b8mr788475pfv.5.1644873280251; Mon, 14 Feb 2022 13:14:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644873280; cv=none; d=google.com; s=arc-20160816; b=zn+GH9dDDKbP+aHMsoNqiLnl/Q/KTtcH4UTVdKvFcwuUQ3kiW5lQ/RxloTX58rDWrN nfdLUJ55TyotaETIDeU3cZt0uvndniVoGdM5oRcXGROjE7XaUGE3SyUK2w9LmFCGnpep garh7JaG+FHFYvT0OJ830vAWRIGXmYcBZ4BTG+oQp2n/oHbrz1Chf7vwc4S6bXga8w91 1jsJivjpLYHzSqO92+oI9e25yPMG4+qQDVFm1eyEwnf/jKeg03fjUhcdvulNc4nwzND/ SCz5SbrBIPST9Ops5OXlTKkLVFo8fJPOWn+w7uyNhrKwqeC/ksNJDvETmfktOaj0NplH bMlw== 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=pKqM4mKfJ8QTe9vNLjBzeo1GOUs12PTfvHsL0wiZI/8=; b=qWtm9TUHFAmjJ0ewRyJpGd2B5Bz1+0niJqvvfK57J1Fk31ZG1Ka82Sn2deNn1uCyVr 31Qc/BuJy9hba1mccHOB2ruO6kpd4YIQL4g7WrfpnrQqhkWhEhQDiGYk4fAZo4H2sRiz 3obNdamvu4OBr3yb7Ok28E7L5ExjDnQp69CX299ZVdd5bem/3DGETmw2G4quUCv+oIQh dzU3FtwxJAqbbI2WIrtqu+PLODpYX0+Pu2Fm/w5NDNVHckM8dQSSTO3TI6OK7+2Ru7Sd EY9vEOesB2ACpjUNFlZ8drgRbjVbWvfAqhBBV97SSvjYK7/W+KM0Bo9Kuuq7J2C61WgP xKcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mzo1APez; 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 d1si11738912pla.362.2022.02.14.13.14.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Feb 2022 13:14:40 -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=mzo1APez; 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 6A9B510E067; Mon, 14 Feb 2022 12:33:26 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347156AbiBNK2X (ORCPT + 99 others); Mon, 14 Feb 2022 05:28:23 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:34776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347938AbiBNK0h (ORCPT ); Mon, 14 Feb 2022 05:26:37 -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 D51AC8091B; Mon, 14 Feb 2022 01:57:37 -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 EBF4360FA2; Mon, 14 Feb 2022 09:57:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C2E05C340E9; Mon, 14 Feb 2022 09:57:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644832654; bh=saiZqjZcHJGpeZpPA0bHrcwnllIhia1FLnu2M+Iq5Lw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mzo1APez4K60Qqh3xCmjD5cpfmd9StcEo08AmuoQbbdyzH4WY7kqi0bA2l2/pbiGX Opk/Cl9Zo32lk4ByX0MyC7RcDpPDMBjFnmkUQbphKfinOMZqHxvZHnlYF26cv9+Hg4 IxzxbLoJrWypNGM7x5H5XpBfRYaTf12SsAb1nMFM= 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.16 084/203] nvme-tcp: fix bogus request completion when failing to send AER Date: Mon, 14 Feb 2022 10:25:28 +0100 Message-Id: <20220214092513.128502574@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092510.221474733@linuxfoundation.org> References: <20220214092510.221474733@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 @@ -913,7 +913,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)