diff options
| author | Christoph Hellwig <[email protected]> | 2021-06-05 14:09:50 +0000 |
|---|---|---|
| committer | Jens Axboe <[email protected]> | 2021-06-11 17:50:54 +0000 |
| commit | 990e78116d38059c9306cf0560c1c4ed1cf358d3 (patch) | |
| tree | 57bb97c10809dfe355358a61c0e0c53abd8aab61 /tools/perf/scripts/python/syscall-counts-by-pid.py | |
| parent | bcache: avoid oversized read request in cache missing code path (diff) | |
| download | kernel-990e78116d38059c9306cf0560c1c4ed1cf358d3.tar.gz kernel-990e78116d38059c9306cf0560c1c4ed1cf358d3.zip | |
block: loop: fix deadlock between open and remove
Commit c76f48eb5c08 ("block: take bd_mutex around delete_partitions in
del_gendisk") adds disk->part0->bd_mutex in del_gendisk(), this way
causes the following AB/BA deadlock between removing loop and opening
loop:
1) loop_control_ioctl(LOOP_CTL_REMOVE)
-> mutex_lock(&loop_ctl_mutex)
-> del_gendisk
-> mutex_lock(&disk->part0->bd_mutex)
2) blkdev_get_by_dev
-> mutex_lock(&disk->part0->bd_mutex)
-> lo_open
-> mutex_lock(&loop_ctl_mutex)
Add a new Lo_deleting state to remove the need for clearing
->private_data and thus holding loop_ctl_mutex in the ioctl
LOOP_CTL_REMOVE path.
Based on an analysis and earlier patch from
Ming Lei <[email protected]>.
Reported-by: Colin Ian King <[email protected]>
Fixes: c76f48eb5c08 ("block: take bd_mutex around delete_partitions in del_gendisk")
Signed-off-by: Christoph Hellwig <[email protected]>
Tested-by: Colin Ian King <[email protected]>
Reviewed-by: Ming Lei <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/syscall-counts-by-pid.py')
0 files changed, 0 insertions, 0 deletions
