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=-6.8 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 autolearn=ham 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 0428DC432C0 for ; Mon, 25 Nov 2019 17:44:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D107520740 for ; Mon, 25 Nov 2019 17:44:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574703869; bh=nB0dmtm2dEaR8IKeqrttIJqG/Pzr5lqbqZLKsmzAtvA=; h=Subject:To:Cc:From:Date:List-ID:From; b=IhOHAc6yrfpa0XJcXe+ORd5O+cpSyB5ZRIcqEL3HJ0uodhb5Qs0irwp7jJDTWm7K2 WRG3r5+Uu90q+lkTu/f22i2IX7E5XI6oa3sM6u5sWKN8LQBRszp8AKWAebNvjETFQg 4TNVQTMJbH9mOl4xdC5rv1qi7GRpFttjkrQ8GfCY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727208AbfKYRo3 (ORCPT ); Mon, 25 Nov 2019 12:44:29 -0500 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:51721 "EHLO out2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725851AbfKYRo3 (ORCPT ); Mon, 25 Nov 2019 12:44:29 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 17142226BD; Mon, 25 Nov 2019 12:44:28 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 25 Nov 2019 12:44:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=7Ppzmi iPmzdPbczQClH8vKGpEFzldIhO9PpKtVc7Lpk=; b=HKCoxnfyUQWTSQ/ZUWk3+c gxdDbnj4EvM5k56I2nFTqpnRURezPP5yQ2Wgw7QrSG62R9wCOIzgstOj3FEhkfrs S6T3cOGsUdlRAC++tKMQI5FOZ0rHPAaTYhSe6LBzzf7cK0ohTX6x6U2Suw2qFoK/ 723jwl1m60KYLqlqy/m83ncOPOnsa1iXVz41T1AFegegt2xawEwUAFbntRBmG4KS wSKP8qIm/rJHBaNey0TTpuFdmPVcpxv7c5LrIyGChAMLLEKYdEfZJkMETrwYXeDl TunYmqe55un3yDpssCmZhOfOqc+2/TIMq5QPO5XixRnjIXwNmCgR4TtljEj/6VLw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrudeiuddguddthecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepuffvhfffkfggtgfgsehtkeertd dttdflnecuhfhrohhmpeeoghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnrdho rhhgqeenucfkphepkeefrdekiedrkeelrddutdejnecurfgrrhgrmhepmhgrihhlfhhroh hmpehgrhgvgheskhhrohgrhhdrtghomhenucevlhhushhtvghrufhiiigvpedv X-ME-Proxy: Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id A7CDC306005B; Mon, 25 Nov 2019 12:44:27 -0500 (EST) Subject: FAILED: patch "[PATCH] virtio_ring: fix return code on DMA mapping fails" failed to apply to 4.19-stable tree To: pasic@linux.ibm.com, mimu@linux.ibm.com, mst@redhat.com Cc: From: Date: Mon, 25 Nov 2019 18:44:26 +0100 Message-ID: <1574703866101156@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 4.19-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From f7728002c1c7bfa787b276a31c3ef458739b8e7c Mon Sep 17 00:00:00 2001 From: Halil Pasic Date: Thu, 14 Nov 2019 13:46:46 +0100 Subject: [PATCH] virtio_ring: fix return code on DMA mapping fails Commit 780bc7903a32 ("virtio_ring: Support DMA APIs") makes virtqueue_add() return -EIO when we fail to map our I/O buffers. This is a very realistic scenario for guests with encrypted memory, as swiotlb may run out of space, depending on it's size and the I/O load. The virtio-blk driver interprets -EIO form virtqueue_add() as an IO error, despite the fact that swiotlb full is in absence of bugs a recoverable condition. Let us change the return code to -ENOMEM, and make the block layer recover form these failures when virtio-blk encounters the condition described above. Cc: stable@vger.kernel.org Fixes: 780bc7903a32 ("virtio_ring: Support DMA APIs") Signed-off-by: Halil Pasic Tested-by: Michael Mueller Signed-off-by: Michael S. Tsirkin diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index a8041e451e9e..867c7ebd3f10 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -583,7 +583,7 @@ static inline int virtqueue_add_split(struct virtqueue *_vq, kfree(desc); END_USE(vq); - return -EIO; + return -ENOMEM; } static bool virtqueue_kick_prepare_split(struct virtqueue *_vq) @@ -1085,7 +1085,7 @@ static int virtqueue_add_indirect_packed(struct vring_virtqueue *vq, kfree(desc); END_USE(vq); - return -EIO; + return -ENOMEM; } static inline int virtqueue_add_packed(struct virtqueue *_vq,