Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6265886imu; Mon, 21 Jan 2019 06:05:49 -0800 (PST) X-Google-Smtp-Source: ALg8bN4gR0Dt12pxu5wsj/r+h1ozfIsGPPJPEpWWPryQjUcpZJI2+GRY1IAbewDe+geHThivCfaj X-Received: by 2002:a65:40c5:: with SMTP id u5mr27548134pgp.46.1548079548984; Mon, 21 Jan 2019 06:05:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548079548; cv=none; d=google.com; s=arc-20160816; b=ln0fpo7r9MOrje7it/XsgJoaMph9amT8q+uWa0fC7xs/tUftzFQkEXw/K2jxhfYdaC q29dynsIk+R2c5UGwOmzzWl552kIeyGJLvwdRGZiOFE1UgDdffYiDAl51al/sZNdGIlh UpGMnl6jtEVAeFBdaXJmNqF5EWuQCeu1rrNqLDo2SuDMEs3+dlEYES1sUlvRCbpZUOG8 y9llCXLzWGOuApr656mCk2UiynksoCgi5igSrYCvxXQU+7Fn2vqMFoky1bN2WBYmz0Xo klkKGUBgCec0mBBuzppQzAwwPlnOmD1mCkYwSsYSRkBOfkl4/7zPxulqEoVRF94hJhal mHuQ== 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=njzD0ALd4j+V6j3oiRRqiWF4V59p6Ru9gQV0HcOb1ws=; b=tgIZAays2MRghDBkwCU8/9ZdCzLjxOQ6UVY2HULF6Zq9CydLo8CiAzzQOv4Ys2a3ng 4voj5SPJucuwIS5IjcCh6Wpgl5M7ahv4HqVCM/gu7XFBWeumjn7pvBYjwkvvsUE5vzJs bi3O7mmwgdU+9s1bjlRTaXU9OZNw2vFlH/yGMo2KxxR+CuBkIyCrEzHclQ868dWeTjLO 0wrMGnYiM/TpuwqiJwcy9Gv7k0roOaU0XWaIyNrajVLgru+tNthFxclY2eQZsbTia0Le O1sWB4KlDAqonnRRszFz3gJalqo8JNB7InNEQWUWOCAsZqBQXEmnzX8eyy4avzURTcb6 BHxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="OY1Q7/h2"; 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 t13si13158427pgm.175.2019.01.21.06.05.32; Mon, 21 Jan 2019 06:05:48 -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="OY1Q7/h2"; 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 S1732831AbfAUOCf (ORCPT + 99 others); Mon, 21 Jan 2019 09:02:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:50172 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732820AbfAUOCc (ORCPT ); Mon, 21 Jan 2019 09:02:32 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.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 1C5F32089F; Mon, 21 Jan 2019 14:02:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548079351; bh=EqleEmAB6Iv+yxeVZSRrZ0ZCWAIcTJ51XrAETnfBNR0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OY1Q7/h2jC7qtmAiZjSxqTA3iDAB3EXLDmXy6svvB4TtO0N60C0dBFlLjsvacpuyW +orOh7G9U3ZmNq1PPGG6oHXDVyXIoM6xgMv9Br9DC9nRR8y5pupL6x+9q2xdyZgTt/ lCGsmH3q9/+KRYpPhJFY8eMJTTP/F4LxmD3GJnrI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jan Kara , Jens Axboe Subject: [PATCH 4.19 95/99] loop: Get rid of nested acquisition of loop_ctl_mutex Date: Mon, 21 Jan 2019 14:49:27 +0100 Message-Id: <20190121134919.547083403@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190121134913.924726465@linuxfoundation.org> References: <20190121134913.924726465@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jan Kara commit c28445fa06a3a54e06938559b9514c5a7f01c90f upstream. The nested acquisition of loop_ctl_mutex (->lo_ctl_mutex back then) has been introduced by commit f028f3b2f987e "loop: fix circular locking in loop_clr_fd()" to fix lockdep complains about bd_mutex being acquired after lo_ctl_mutex during partition rereading. Now that these are properly fixed, let's stop fooling lockdep. Signed-off-by: Jan Kara Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- drivers/block/loop.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -682,7 +682,7 @@ static int loop_change_fd(struct loop_de int error; bool partscan; - error = mutex_lock_killable_nested(&loop_ctl_mutex, 1); + error = mutex_lock_killable(&loop_ctl_mutex); if (error) return error; error = -ENXIO; @@ -920,7 +920,7 @@ static int loop_set_fd(struct loop_devic if (!file) goto out; - error = mutex_lock_killable_nested(&loop_ctl_mutex, 1); + error = mutex_lock_killable(&loop_ctl_mutex); if (error) goto out_putf; @@ -1136,7 +1136,7 @@ static int loop_clr_fd(struct loop_devic { int err; - err = mutex_lock_killable_nested(&loop_ctl_mutex, 1); + err = mutex_lock_killable(&loop_ctl_mutex); if (err) return err; if (lo->lo_state != Lo_bound) { @@ -1173,7 +1173,7 @@ loop_set_status(struct loop_device *lo, struct block_device *bdev; bool partscan = false; - err = mutex_lock_killable_nested(&loop_ctl_mutex, 1); + err = mutex_lock_killable(&loop_ctl_mutex); if (err) return err; if (lo->lo_encrypt_key_size && @@ -1278,7 +1278,7 @@ loop_get_status(struct loop_device *lo, struct kstat stat; int ret; - ret = mutex_lock_killable_nested(&loop_ctl_mutex, 1); + ret = mutex_lock_killable(&loop_ctl_mutex); if (ret) return ret; if (lo->lo_state != Lo_bound) { @@ -1467,7 +1467,7 @@ static int lo_simple_ioctl(struct loop_d { int err; - err = mutex_lock_killable_nested(&loop_ctl_mutex, 1); + err = mutex_lock_killable(&loop_ctl_mutex); if (err) return err; switch (cmd) {