diff options
author | Yu Kuai <yukuai3@huawei.com> | 2023-11-25 16:16:03 +0800 |
---|---|---|
committer | Song Liu <song@kernel.org> | 2023-11-27 15:49:05 -0800 |
commit | ad8606702f268903b26795e6b93605646fd1a6a8 (patch) | |
tree | 2bfd1c6af1b58d618bcd5841ae5ee84bc9649a71 /drivers/md/raid5.h | |
parent | 2d32777d60de81aa020a2431567020af26564c71 (diff) |
md/raid5: remove rcu protection to access rdev from conf
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 'reconfig_lock' is held, because rdev can't be added or removed from
array;
- If there is normal IO inflight, because mddev_suspend() will prevent
rdev to be added or removed from array;
- If there is sync IO inflight, because 'MD_RECOVERY_RUNNING' is
checked in remove_and_add_spares().
And these will cover all the scenarios in raid456.
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20231125081604.3939938-5-yukuai1@huaweicloud.com
Diffstat (limited to 'drivers/md/raid5.h')
-rw-r--r-- | drivers/md/raid5.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/raid5.h b/drivers/md/raid5.h index 22bea20eccbd..9b5a7dc3f2a0 100644 --- a/drivers/md/raid5.h +++ b/drivers/md/raid5.h @@ -473,8 +473,8 @@ enum { */ struct disk_info { - struct md_rdev __rcu *rdev; - struct md_rdev __rcu *replacement; + struct md_rdev *rdev; + struct md_rdev *replacement; struct page *extra_page; /* extra page to use in prexor */ }; |