Commit 570b914
md: use RCU lock to protect traversal in md_spares_need_change()
Since md_start_sync() will be called without the protect of mddev_lock,
and it can run concurrently with array reconfiguration, traversal of rdev
in it should be protected by RCU lock.
Commit bc08041 ("md: suspend array in md_start_sync() if array need
reconfiguration") added md_spares_need_change() to md_start_sync(),
casusing use of rdev without any protection.
Fix this by adding RCU lock in md_spares_need_change().
Fixes: bc08041 ("md: suspend array in md_start_sync() if array need reconfiguration")
Cc: stable@vger.kernel.org # 6.7+
Signed-off-by: Li Lingfeng <lilingfeng3@huawei.com>
Signed-off-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20240104133629.1277517-1-lilingfeng@huaweicloud.com1 parent 9cfcf99 commit 570b914
1 file changed
+7
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9240 | 9240 | | |
9241 | 9241 | | |
9242 | 9242 | | |
9243 | | - | |
9244 | | - | |
| 9243 | + | |
| 9244 | + | |
| 9245 | + | |
| 9246 | + | |
9245 | 9247 | | |
| 9248 | + | |
| 9249 | + | |
| 9250 | + | |
9246 | 9251 | | |
9247 | 9252 | | |
9248 | 9253 | | |
| |||
0 commit comments