Thread (2 messages) 2 messages, 2 authors, 2024-01-30

Re: [PATCH] md: use RCU lock to protect traversal in md_spares_need_change()

From: Song Liu <song@kernel.org>
Date: 2024-01-30 07:11:31
Also in: lkml

On Thu, Jan 4, 2024 at 5:39 AM Li Lingfeng [off-list ref] wrote:
From: Li Lingfeng <redacted>

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 bc08041b32ab ("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: bc08041b32ab ("md: suspend array in md_start_sync() if array need reconfiguration")
Signed-off-by: Li Lingfeng <redacted>
Looks good to me. Applied to md-tmp-6.9.

Thanks,
Song
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help