Re: [PATCH v2] md/raid10: Remove rcu_dereference when it doesn't need rcu lock to protect

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Aug 20, 2021 at 5:31 PM Song Liu <song@xxxxxxxxxx> wrote:
>
> On Tue, Aug 17, 2021 at 10:58 PM Xiao Ni <xni@xxxxxxxxxx> wrote:
> >
> > One warning message is triggered like this:
> > [  695.110751] =============================
> > [  695.131439] WARNING: suspicious RCU usage
> > [  695.151389] 4.18.0-319.el8.x86_64+debug #1 Not tainted
> > [  695.174413] -----------------------------
> > [  695.192603] drivers/md/raid10.c:1776 suspicious
> > rcu_dereference_check() usage!
> > [  695.225107] other info that might help us debug this:
> > [  695.260940] rcu_scheduler_active = 2, debug_locks = 1
> > [  695.290157] no locks held by mkfs.xfs/10186.
> >
> > 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 rdev->nr_pending. 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.
> >
> > Fixes: d30588b2731f ('md/raid10: improve raid10 discard request')
> > Signed-off-by: Xiao Ni <xni@xxxxxxxxxx>
> > Acked-by: Guoqing Jiang <guoqing.jiang@xxxxxxxxx>
>
> Applied to md-fixes. Thanks!

Moved to md-next as we are too close to 5.14 release.

Thanks,
Song



[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux