Re: [PATCH v2] block: fix deadlock between bd_link_disk_holder and partition scan

From: Jens Axboe
Date: Fri Feb 23 2024 - 09:47:07 EST



On Wed, 21 Feb 2024 17:01:22 +0800, linan666@xxxxxxxxxxxxxxx wrote:
> 'open_mutex' of gendisk is used to protect open/close block devices. But
> in bd_link_disk_holder(), it is used to protect the creation of symlink
> between holding disk and slave bdev, which introduces some issues.
>
> When bd_link_disk_holder() is called, the driver is usually in the process
> of initialization/modification and may suspend submitting io. At this
> time, any io hold 'open_mutex', such as scanning partitions, can cause
> deadlocks. For example, in raid:
>
> [...]

Applied, thanks!

[1/1] block: fix deadlock between bd_link_disk_holder and partition scan
commit: 03f12122b20b6e6028e9ed69030a49f9cffcbb75

Best regards,
--
Jens Axboe