Commit cd32b27
md/dm-raid: don't call md_reap_sync_thread() directly
Currently md_reap_sync_thread() is called from raid_message() directly
without holding 'reconfig_mutex', this is definitely unsafe because
md_reap_sync_thread() can change many fields that is protected by
'reconfig_mutex'.
However, hold 'reconfig_mutex' here is still problematic because this
will cause deadlock, for example, commit 130443d ("md: refactor
idle/frozen_sync_thread() to fix deadlock").
Fix this problem by using stop_sync_thread() to unregister sync_thread,
like md/raid did.
Fixes: be83651 ("DM RAID: Add message/status support for changing sync action")
Cc: stable@vger.kernel.org # v6.7+
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Xiao Ni <xni@redhat.com>
Acked-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20240305072306.2562024-7-yukuai1@huaweicloud.com1 parent 16c4770 commit cd32b27
1 file changed
Lines changed: 18 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3719 | 3719 | | |
3720 | 3720 | | |
3721 | 3721 | | |
| 3722 | + | |
3722 | 3723 | | |
3723 | 3724 | | |
3724 | 3725 | | |
3725 | 3726 | | |
3726 | 3727 | | |
3727 | 3728 | | |
3728 | 3729 | | |
3729 | | - | |
3730 | | - | |
3731 | | - | |
3732 | | - | |
| 3730 | + | |
| 3731 | + | |
| 3732 | + | |
| 3733 | + | |
3733 | 3734 | | |
3734 | | - | |
3735 | | - | |
3736 | | - | |
3737 | | - | |
3738 | | - | |
3739 | | - | |
| 3735 | + | |
| 3736 | + | |
| 3737 | + | |
| 3738 | + | |
| 3739 | + | |
| 3740 | + | |
| 3741 | + | |
| 3742 | + | |
| 3743 | + | |
| 3744 | + | |
| 3745 | + | |
| 3746 | + | |
| 3747 | + | |
3740 | 3748 | | |
3741 | 3749 | | |
3742 | 3750 | | |
| |||
0 commit comments