Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp4487358ybx; Mon, 4 Nov 2019 14:14:33 -0800 (PST) X-Google-Smtp-Source: APXvYqy0V7Q8lefgQO4/kheR6Wc1djUxlGphOxge5lDKWitQ2gm3aqKzy92YCeSoCedvxNQ3SlOG X-Received: by 2002:a50:8e43:: with SMTP id 3mr7644334edx.217.1572905673036; Mon, 04 Nov 2019 14:14:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572905673; cv=none; d=google.com; s=arc-20160816; b=CypXV/sn7xnq5qspmBE56YHxW4wzIXQ2LNnqIn9ujITyNsfCetKQJGbVR6QjbteGPt XRVb9fkm+iQrC+vcHxNlr6Zfxc/vlLuY7ALgZaz48sHL1O/hkNEIL1xpdbdhSDlckJ8v NdfkB9xEG6ED5YEMZScNqp8KqBnOG77ekEdnb4QnL+O/9KCNrQq0rem308cmrQRfJyJu pjMuciRAlsqpkYRMEzf2rQ365IyVpXrfRqMAeSjOpNlkqdA5B/Trtc8tI2LJdEAou08+ NE4V3NwSC1DF4UANifUwJhX1SuC+1K/mMYEMhi7MsGD0MAaJjYq6m2vqxmnDiMu2vBRn aRAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6VXuqqBjMsHrUT2qjwqukfayG41ciCrpQBLTXKLeEpA=; b=fUfdN8qz9HPw7TYiLX+E4oTtekXhDfV9o898xa028kjbo1aHPpGKwftR3IzBQkhVLi hPSTHeBZfkzE1xPLo26R4k0TxnvsdnjnxtDeq85a5LVw4b7LHuC8vOuk3pzD+SSiLngW GcBOOTl+n1vG9xAoQua1ZLOlQVolPEC2FHWPnJVpMGfAPoYkygWIwnb84i+RNlejYJym ctlW58Uan4OXeXRJWQtvujaSiGPXjq4W6XpS093vc/jUAYoNrL8B0HfJDyi8UXmDlHAL XV3Id2lebVZGTAxwEGXGh72BjZmu7FHZDlDRPRREB0FJ7VXW0QbAQODc7aVklnk3YP0H mN/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HfFB5Gui; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m4si1802747ejr.90.2019.11.04.14.14.09; Mon, 04 Nov 2019 14:14:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HfFB5Gui; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390417AbfKDWJc (ORCPT + 99 others); Mon, 4 Nov 2019 17:09:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:42620 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390410AbfKDWJ3 (ORCPT ); Mon, 4 Nov 2019 17:09:29 -0500 Received: from localhost (6.204-14-84.ripe.coltfrance.com [84.14.204.6]) (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 6BCC2205C9; Mon, 4 Nov 2019 22:09:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572905369; bh=rAJzLnzBVgEPuV8kR1+7VCm/ydjwode9suZJvidJaO4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HfFB5GuiEk3eLVVUzcpMJ340Z1NTOaU8ZsZjuaGyUdMoNwIKyfar0npfGU8h0DOhV Sqcp7UJJ4jXh3/wGWZPRACExJ+0E+P0IEY5myio5+8uWPFfypAkfdJ9/nayR132I07 TbHJVo9qK9bNQGM9Sb/agBxq3ZG4oWoGsQy0zU7s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Anton Ivanov , Jens Axboe Subject: [PATCH 5.3 121/163] um-ubd: Entrust re-queue to the upper layers Date: Mon, 4 Nov 2019 22:45:11 +0100 Message-Id: <20191104212148.975125444@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191104212140.046021995@linuxfoundation.org> References: <20191104212140.046021995@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Anton Ivanov commit d848074b2f1eb11a38691285f7366bce83087014 upstream. Fixes crashes due to ubd requeue logic conflicting with the block-mq logic. Crash is reproducible in 5.0 - 5.3. Fixes: 53766defb8c8 ("um: Clean-up command processing in UML UBD driver") Cc: stable@vger.kernel.org # v5.0+ Signed-off-by: Anton Ivanov Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- arch/um/drivers/ubd_kern.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- a/arch/um/drivers/ubd_kern.c +++ b/arch/um/drivers/ubd_kern.c @@ -1403,8 +1403,12 @@ static blk_status_t ubd_queue_rq(struct spin_unlock_irq(&ubd_dev->lock); - if (ret < 0) - blk_mq_requeue_request(req, true); + if (ret < 0) { + if (ret == -ENOMEM) + res = BLK_STS_RESOURCE; + else + res = BLK_STS_DEV_RESOURCE; + } return res; }