Re: [PATCH -next 2/6] md: remove flag RemoveSynchronized

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

 



On Sun, Oct 15, 2023 at 6:28 PM Yu Kuai <yukuai1@xxxxxxxxxxxxxxx> wrote:
>
> From: Yu Kuai <yukuai3@xxxxxxxxxx>
>
> rcu is not used correctly here, because synchronize_rcu() is called
> before replacing old value, for example:
>
> remove_and_add_spares   // other path
>  synchronize_rcu
>  // called before replacing old value
>  set_bit(RemoveSynchronized)
>                         rcu_read_lock()
>                         rdev = conf->mirros[].rdev
>  pers->hot_remove_disk
>   conf->mirros[].rdev = NULL;
>   if (!test_bit(RemoveSynchronized))
>    synchronize_rcu
>    /*
>     * won't be called, and won't wait
>     * for concurrent readers to be done.
>     /*
>                         // access rdev after remove_and_add_spares()
>                         rcu_read_unlock()

I am having a hard time following the description here. Please be more
specific about what issue we are fixing here.

Thanks,
Song

>
> Hence remove this flag and prepare to remove rcu protection to access
> rdev from 'conf'.
>
> Signed-off-by: Yu Kuai <yukuai3@xxxxxxxxxx>
> ---
[...]




[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