aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid5-cache.c
diff options
context:
space:
mode:
authorLi Lingfeng <[email protected]>2023-08-03 07:17:11 +0000
committerSong Liu <[email protected]>2023-08-15 16:40:26 +0000
commit7eb8ff02c1df279bf7f7f29b866beb655a9eebe9 (patch)
treecb3020d5e092ac44bef479e32bb05730aeafbc06 /drivers/md/raid5-cache.c
parentmd/raid10: fix a 'conf->barrier' leakage in raid10_takeover() (diff)
downloadkernel-7eb8ff02c1df279bf7f7f29b866beb655a9eebe9.tar.gz
kernel-7eb8ff02c1df279bf7f7f29b866beb655a9eebe9.zip
md: Hold mddev->reconfig_mutex when trying to get mddev->sync_thread
Commit ba9d9f1a707f ("Revert "md: unlock mddev before reap sync_thread in action_store"") removed the scenario of calling md_unregister_thread() without holding mddev->reconfig_mutex, so add a lock holding check before acquiring mddev->sync_thread by passing mdev to md_unregister_thread(). Signed-off-by: Li Lingfeng <[email protected]> Reviewed-by: Yu Kuai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Song Liu <[email protected]>
Diffstat (limited to 'drivers/md/raid5-cache.c')
-rw-r--r--drivers/md/raid5-cache.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c
index 2eac4a50d99b..a29b9650260a 100644
--- a/drivers/md/raid5-cache.c
+++ b/drivers/md/raid5-cache.c
@@ -3168,7 +3168,7 @@ void r5l_exit_log(struct r5conf *conf)
{
struct r5l_log *log = conf->log;
- md_unregister_thread(&log->reclaim_thread);
+ md_unregister_thread(conf->mddev, &log->reclaim_thread);
/*
* 'reconfig_mutex' is held by caller, set 'confg->log' to NULL to