# Re: \[PATCH 1/1\] md/raid10: Remove rcu\_dereference when it doesn't need rcu lock to protect

- From: Guoqing Jiang \<hidden\>
- Date: 2021-08-16 06:36:07 
- List: linux-raid
- Page: https://ratatoskr.run/linux-raid/2021/08/6640566
- Thread: https://ratatoskr.run/linux-raid/2021/08/6640542/t.md

```text


On 8/9/21 12:01 PM, Xiao Ni wrote:
> In the first loop of function raid10_handle_discard. It already
> determines which disk need to handle discard request and add the
> rdev reference count. So the conf->mirrors will not change until
> all bios come back from underlayer disks. It doesn't need to use
> rcu_dereference to get rdev.

Can rdev be removed between the first loop and the second loop?

Thanks,
Guoqing
```
