]> Git Repo - linux.git/commit
md/raid1: remove rcu protection to access rdev from conf
authorYu Kuai <[email protected]>
Sat, 25 Nov 2023 08:16:02 +0000 (16:16 +0800)
committerSong Liu <[email protected]>
Mon, 27 Nov 2023 23:49:05 +0000 (15:49 -0800)
commit2d32777d60de81aa020a2431567020af26564c71
tree3dad0d0028d6b6510a59178c826301c12b89ce20
parenta448af25becf4b555660b5ba2618c7ed3c4de6da
md/raid1: 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 raid1.

Signed-off-by: Yu Kuai <[email protected]>
Signed-off-by: Song Liu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
drivers/md/raid1.c
This page took 0.050448 seconds and 4 git commands to generate.