From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4D3FC433E0 for ; Tue, 23 Jun 2020 21:27:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AB7992078A for ; Tue, 23 Jun 2020 21:27:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592947621; bh=UpmWjVDb2Zz7jPjmPm5Uk7yI4I8pS8mSFJu6GDPjzdU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=MtrB08xJ41NK8pdgF7TZW5zVBJF8QKEy4P23jJEjgLVTMwPx/Q+atl/uMrfSKPRDv yRteyQ8cbnfWMCt6UOCEkOOGRya5Gjfns1qnj7MFFogIlNkKKcqjxPVgyTuMimOWSL wBqbX+TEejIERkLQTzPxO8pmQAeTdtHXc6izZOkA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388331AbgFWV0v (ORCPT ); Tue, 23 Jun 2020 17:26:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:33728 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388684AbgFWURc (ORCPT ); Tue, 23 Jun 2020 16:17:32 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 097AC21473; Tue, 23 Jun 2020 20:17:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592943452; bh=UpmWjVDb2Zz7jPjmPm5Uk7yI4I8pS8mSFJu6GDPjzdU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=x77WVf49QN+QxOl2N4eyrdfE8/wRmjwI+yAW1WWg4kp1v+Oyz7cs2szl4/16IQ/9N 3EbcvDWXPcuw035JivICxJejRfkkY0oV2Gofo7YWdpAwrzWxpANjcy3xaUhSbARvdC 2Fzea4plhKSK7P4gwgjDeXakzuKzetGhqf0LTMrU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Wagner , Himanshu Madhani , Hannes Reinecke , James Smart , Christoph Hellwig , Jens Axboe , Sasha Levin Subject: [PATCH 5.7 370/477] nvme-fc: dont call nvme_cleanup_cmd() for AENs Date: Tue, 23 Jun 2020 21:56:07 +0200 Message-Id: <20200623195425.020114039@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200623195407.572062007@linuxfoundation.org> References: <20200623195407.572062007@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Daniel Wagner [ Upstream commit c9c12e51b82b2bd0c59ac4e27ee5427f382a503f ] Asynchronous event notifications do not have an associated request. When fcp_io() fails we unconditionally call nvme_cleanup_cmd() which leads to a crash. Fixes: 16686f3a6c3c ("nvme: move common call to nvme_cleanup_cmd to core layer") Signed-off-by: Daniel Wagner Reviewed-by: Himanshu Madhani Reviewed-by: Hannes Reinecke Reviewed-by: James Smart Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- drivers/nvme/host/fc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c index 5ef4a84c442a1..564e3f220ac79 100644 --- a/drivers/nvme/host/fc.c +++ b/drivers/nvme/host/fc.c @@ -2300,10 +2300,11 @@ nvme_fc_start_fcp_op(struct nvme_fc_ctrl *ctrl, struct nvme_fc_queue *queue, opstate = atomic_xchg(&op->state, FCPOP_STATE_COMPLETE); __nvme_fc_fcpop_chk_teardowns(ctrl, op, opstate); - if (!(op->flags & FCOP_FLAGS_AEN)) + if (!(op->flags & FCOP_FLAGS_AEN)) { nvme_fc_unmap_data(ctrl, op->rq, op); + nvme_cleanup_cmd(op->rq); + } - nvme_cleanup_cmd(op->rq); nvme_fc_ctrl_put(ctrl); if (ctrl->rport->remoteport.port_state == FC_OBJSTATE_ONLINE && -- 2.25.1