From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AAF0A20F98 for ; Fri, 21 Jul 2023 19:13:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2FA24C433C7; Fri, 21 Jul 2023 19:13:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1689966798; bh=XomBoqAHlm56aIkKipqRyvVRyTf7BLo23ZbPS9dxaaw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DiPPk2JRxNM7kw2ry4QHWDzpOdxynkA6lKnAeWuysm5uYUciOjnUAoza0NZgqnpRe 2dzqYas9mcnF4O5LRE4wyYyoRYH3VYbdJD4NqJJ7w6CTaaboL7vBZXEPT6G/727ABg v/Z1xbWbSbGlZd8Oz3mUnWurObtirQrzK1DkjURU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Guangwu Zhang , Ming Lei , Christoph Hellwig , Keith Busch , Sasha Levin Subject: [PATCH 5.15 443/532] nvme-pci: fix DMA direction of unmapping integrity data Date: Fri, 21 Jul 2023 18:05:47 +0200 Message-ID: <20230721160638.582240766@linuxfoundation.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230721160614.695323302@linuxfoundation.org> References: <20230721160614.695323302@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Ming Lei [ Upstream commit b8f6446b6853768cb99e7c201bddce69ca60c15e ] DMA direction should be taken in dma_unmap_page() for unmapping integrity data. Fix this DMA direction, and reported in Guangwu's test. Reported-by: Guangwu Zhang Fixes: 4aedb705437f ("nvme-pci: split metadata handling from nvme_map_data / nvme_unmap_data") Signed-off-by: Ming Lei Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch Signed-off-by: Sasha Levin --- drivers/nvme/host/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 26b315c5025ad..bb3813e8474f4 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -965,7 +965,7 @@ static void nvme_pci_complete_rq(struct request *req) struct nvme_iod *iod = blk_mq_rq_to_pdu(req); dma_unmap_page(dev->dev, iod->meta_dma, - rq_integrity_vec(req)->bv_len, rq_data_dir(req)); + rq_integrity_vec(req)->bv_len, rq_dma_dir(req)); } if (blk_rq_nr_phys_segments(req)) -- 2.39.2