From patchwork Mon Sep 21 16:27:19 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: 263684 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 7B0B3C43465 for ; Mon, 21 Sep 2020 16:45:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 37F3D239ED for ; Mon, 21 Sep 2020 16:45:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706703; bh=jE+KNy6sH2GYUyNViDM63N8Nh9eGlpSBcc4XAXHGl3I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=VnHHGUGCWgl6sFO6TXg2oZ1JhIhedsYekLyrzHN0Di3xF0mctUEnDixyBhNnlXBWq MhAmm8gBQpeX5Mt79FhpJtINi/cWbWfuu5iQbUvHP10FOobaL/uCRksmUUWNooVwS0 DNdrgN9hgtPSWxWvnMHsgBZz8YvRWFWzJG/ecJZM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729197AbgIUQo6 (ORCPT ); Mon, 21 Sep 2020 12:44:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:50600 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729711AbgIUQo5 (ORCPT ); Mon, 21 Sep 2020 12:44:57 -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 3532E23976; Mon, 21 Sep 2020 16:44:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706696; bh=jE+KNy6sH2GYUyNViDM63N8Nh9eGlpSBcc4XAXHGl3I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jflbdDLfomV1ZEKOHJ5LlhG4PC5DZ97YJDRUQtamVd5BjmCCqZ2TrxWP3yfH91Iaa 9O0KSa2SUsEpfsEMOYOBJq2LA79Bqui9dBznQm9Ld58hocqQ3Uwq9yzfxewj9aNBjf el+CXAZIZ8Me5k9t9s2TXxVMuo7cS3jeZjaRdcto= 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 027/118] nvme-rdma: cancel async events before freeing event struct Date: Mon, 21 Sep 2020 18:27:19 +0200 Message-Id: <20200921162037.576388687@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 925dd04c1f9825194b9e444c12478084813b2b5d ] Cancel async event work in case async event has been queued up, and nvme_rdma_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/rdma.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c index 6c07bb55b0f83..4a0bc8927048a 100644 --- a/drivers/nvme/host/rdma.c +++ b/drivers/nvme/host/rdma.c @@ -809,6 +809,7 @@ static void nvme_rdma_destroy_admin_queue(struct nvme_rdma_ctrl *ctrl, blk_mq_free_tag_set(ctrl->ctrl.admin_tagset); } if (ctrl->async_event_sqe.data) { + cancel_work_sync(&ctrl->ctrl.async_event_work); nvme_rdma_free_qe(ctrl->device->dev, &ctrl->async_event_sqe, sizeof(struct nvme_command), DMA_TO_DEVICE); ctrl->async_event_sqe.data = NULL;