summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-11-03 10:46:35 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2022-10-03 22:49:31 -0400
commit96e9e05ab5df76fa9d3e84a1176989f161ec8ec5 (patch)
tree566078ff0fc7c32fed7f302d2995a43ab6793ee4
parent8a9c0304a3464db98b06e99931de51dda0d9d12f (diff)
loop: Don't call disk_force_media_change from lo_release
This fixes a deadlock that affects bcachefs, where we call blkdev_put() directly from put_super(). put_super -> blkdev_put -> lo_release -> disk_force_media_change -> __invalidate_device -> get_super where we self deadlock on s_umount. It doesn't affect other filesystems because they use the bizzare sget() mechanism for exclusion with other mounts, and thus don't need to close block devices in .put_super(). Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
-rw-r--r--drivers/block/loop.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index ad92192c7d61..123c8837e57b 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -1171,8 +1171,6 @@ static void __loop_clr_fd(struct loop_device *lo, bool release)
if (!release)
blk_mq_unfreeze_queue(lo->lo_queue);
- disk_force_media_change(lo->lo_disk, DISK_EVENT_MEDIA_CHANGE);
-
if (lo->lo_flags & LO_FLAGS_PARTSCAN) {
int err;