lkml.org 
[lkml]   [2019]   [Jan]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4.20 108/111] loop: Get rid of nested acquisition of loop_ctl_mutex
Date
4.20-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jan Kara <jack@suse.cz>

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 <jack@suse.cz>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
drivers/block/loop.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -681,7 +681,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;
@@ -919,7 +919,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;

@@ -1135,7 +1135,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) {
@@ -1172,7 +1172,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 &&
@@ -1277,7 +1277,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) {
@@ -1466,7 +1466,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) {

\
 
 \ /
  Last update: 2019-01-21 15:17    [W:0.267 / U:36.008 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site