Commit 1d5e6419 authored by Yu Kuai's avatar Yu Kuai Committed by Li Nan
Browse files

md/md-multipath: remove rcu protection to access rdev from conf

mainline inclusion
from mainline-next-20231220
commit 7ecab28c3b2c26c1a51154d997433e8432eb49ba
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8T02O

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7ecab28c3b2c26c1a51154d997433e8432eb49ba



--------------------------------

Because it's safe to accees rdev from conf:
 - If any spinlock is held, because synchronize_rcu() from
   md_kick_rdev_from_array() will prevent 'rdev' to be freed until
   spinlock is released;
 - If there is normal IO inflight, because mddev_suspend() will prevent
   rdev to be added or removed from array;

And these will cover all the scenarios in md-multipath.

Signed-off-by: default avatarYu Kuai <yukuai3@huawei.com>
Signed-off-by: default avatarSong Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20231125081604.3939938-6-yukuai1@huaweicloud.com


Signed-off-by: default avatarLi Nan <linan122@huawei.com>
parent 0c90271d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment