From patchwork Mon Sep 21 16:27:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 263610 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=-14.2 required=3.0 tests=BAYES_00,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 00816C43466 for ; Mon, 21 Sep 2020 16:56:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B1D102223E for ; Mon, 21 Sep 2020 16:56:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600707399; bh=E+rZOxxQzIdF/UYon+OMzY0aLfB7pBon3h1gfjUQuhk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=K0DQil4fkFFsnTHENMdrFyVYKgrvGBIU4hN2q5+GgR352msvOWcujv/kashpStR7v 2pia+YuLBjB7T9W+9a3P/0SVHq2xwD3Lc2Ua+3bFYDudnCEukCBNya5avES6gqNQaO xlwtixmI/DXYaODWu+mnFARUuEoFjbeXeUfDHMmU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728732AbgIUQ4c (ORCPT ); Mon, 21 Sep 2020 12:56:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:50670 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728904AbgIUQo7 (ORCPT ); Mon, 21 Sep 2020 12:44:59 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 9AF65235F9; Mon, 21 Sep 2020 16:44:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706699; bh=E+rZOxxQzIdF/UYon+OMzY0aLfB7pBon3h1gfjUQuhk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YGK2A/V2vm4ICp7rue393iTuaakYwfeO+TyAhVRC1YPMmqV8J7uO69ymQQAPXdRVo pQIcRk9Pl6DZCOmEcE+CwqntVPW0pr6/54S5KXvCPXvFUvZcciNEgJSJZPN2vHwMIG aLqfE9Gx5EPuXvl32CUGEYppS5T4t0w57VCDBa64= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Milburn , Keith Busch , Sagi Grimberg , Christoph Hellwig , Sasha Levin Subject: [PATCH 5.8 028/118] nvme-tcp: cancel async events before freeing event struct Date: Mon, 21 Sep 2020 18:27:20 +0200 Message-Id: <20200921162037.624331191@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162036.324813383@linuxfoundation.org> References: <20200921162036.324813383@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: David Milburn [ Upstream commit ceb1e0874dba5cbfc4e0b4145796a4bfb3716e6a ] Cancel async event work in case async event has been queued up, and nvme_tcp_submit_async_event() runs after event has been freed. Signed-off-by: David Milburn Reviewed-by: Keith Busch Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Sasha Levin --- drivers/nvme/host/tcp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c index f1f66bf96cbb9..24467eea73999 100644 --- a/drivers/nvme/host/tcp.c +++ b/drivers/nvme/host/tcp.c @@ -1567,6 +1567,7 @@ static struct blk_mq_tag_set *nvme_tcp_alloc_tagset(struct nvme_ctrl *nctrl, static void nvme_tcp_free_admin_queue(struct nvme_ctrl *ctrl) { if (to_tcp_ctrl(ctrl)->async_req.pdu) { + cancel_work_sync(&ctrl->async_event_work); nvme_tcp_free_async_req(to_tcp_ctrl(ctrl)); to_tcp_ctrl(ctrl)->async_req.pdu = NULL; }