Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp86005ybp; Thu, 3 Oct 2019 10:32:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqxFJnFidcBncB8zN2De5blg4GamrWHpAUsjPdkd1peyQ4R+UET4Tu53pWI7jBQWb14wGeG7 X-Received: by 2002:a17:906:fd4:: with SMTP id c20mr8599770ejk.41.1570123926473; Thu, 03 Oct 2019 10:32:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570123926; cv=none; d=google.com; s=arc-20160816; b=Fbg0960OVll5MPLtR+QnmkYHhRbCMSGD9QjNyGyCtvbkyJ/YRYn05WBljTVZ1qQS5f b6vvzv+t9o/FuX2FPwVTNQgRfVp+frC08ZxSRs9wteaiTFLmMC6LUROu3Wa382NKlZVo 2sAp5rtQgS1DxxKATVnBkOTuLN9JpZ2zA+uo317Gzsb6DTe1KeJ5LY8VCLQwchCX9wVL JTMdfs+34BiFv/yerhht74m+G90avtk5LHFmQLBeh+lNz0N3a80ao6LNBF9bMaH4GegJ TB/bi81/00uSV6x0k4VDAMMR8wPMT7D0uOdYmxF3pvf+n+1jLTMWX8X9H5tg6JhzNvV6 wPLg== 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=XClbnc12BaTgmrY/THHEicWRXyRg26tVHadusnOHIQs=; b=zSoKIN0mVCtQCuYfMRplwuJiTEKuXT2Vvue1c0voOVM/asef6oKP1gTzGAHXd6Mn0S s1mS7u0Y6aXQIRjfl2sOvqeMEfFbwbeEAp2ee7ZbzXVyb0tOlNH014XYwhPkues2v4X8 ef0+qZ3PV6Pioq5Hloc4Kdp2AlrdnBDXofjWqXJKqF3O7Kw8ovrSOEg2hzZvLfpzDDx9 c1mJwcztgKzIILpWND0dTw+ognUoQlwbxpo//fTrahVDGo6oj/VJLCzgZ5O4MMKkq+Sg /Xv7cD419tuDaMwEq4AF8HnvQlwcMPNUS3aZA+cPwiHw7Iy1X4gu1JJMb4sQGFkciJQT IK3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=a2RiLTLU; 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 g14si1822072edm.407.2019.10.03.10.31.42; Thu, 03 Oct 2019 10:32:06 -0700 (PDT) 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=a2RiLTLU; 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 S2389419AbfJCQS0 (ORCPT + 99 others); Thu, 3 Oct 2019 12:18:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:44940 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388580AbfJCQSW (ORCPT ); Thu, 3 Oct 2019 12:18:22 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 050A020865; Thu, 3 Oct 2019 16:18:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570119501; bh=J2DOie5+rJ5lNglv194L5tZNcZlQOsaZ5mRHla4X5YE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a2RiLTLU9P0DvkqLmb5l5cF+Z+xafN4XNnTGw3WoGAY2teR2DexkIscuGen/1yTWo 0sKsQ6AqfhA8Pyk76YDz2vdO5D/JGiWghze9Itd5+McKx8vPfZb7wq5cr+N+gcoPeW tb7Zlbtw/JA8GYqI4EaewFsjcrsNQ6GLZn3B2dWU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Josef Bacik , Mike Christie , Jens Axboe , Sasha Levin Subject: [PATCH 4.19 089/211] nbd: add missing config put Date: Thu, 3 Oct 2019 17:52:35 +0200 Message-Id: <20191003154507.323052521@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154447.010950442@linuxfoundation.org> References: <20191003154447.010950442@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: Mike Christie [ Upstream commit 887e975c4172d0d5670c39ead2f18ba1e4ec8133 ] Fix bug added with the patch: commit 8f3ea35929a0806ad1397db99a89ffee0140822a Author: Josef Bacik Date: Mon Jul 16 12:11:35 2018 -0400 nbd: handle unexpected replies better where if the timeout handler runs when the completion path is and we fail to grab the mutex in the timeout handler we will leave a config reference and cannot free the config later. Reviewed-by: Josef Bacik Signed-off-by: Mike Christie Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- drivers/block/nbd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index fa60f265ee506..b1c7009de1f4d 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -353,8 +353,10 @@ static enum blk_eh_timer_return nbd_xmit_timeout(struct request *req, } config = nbd->config; - if (!mutex_trylock(&cmd->lock)) + if (!mutex_trylock(&cmd->lock)) { + nbd_config_put(nbd); return BLK_EH_RESET_TIMER; + } if (config->num_connections > 1) { dev_err_ratelimited(nbd_to_dev(nbd), -- 2.20.1