diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-11-03 10:46:35 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2022-08-02 17:37:22 -0400 |
commit | e28ba843e2157e9dd8fed0d689b26950b91592e9 (patch) | |
tree | 37072bedfd6b5f92bb230fa0f9c22a135c58bc4b | |
parent | 6b1b212fb1d04e7484a6cea457d3ea5b2b67aa45 (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.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 084f9b8a0ba3..7a420623ac38 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -1166,8 +1166,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; |