lkml.org 
[lkml]   [2023]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH -next 2/6] md: remove flag RemoveSynchronized
On Sun, Oct 15, 2023 at 6:28 PM Yu Kuai <yukuai1@huaweicloud.com> wrote:
>
> From: Yu Kuai <yukuai3@huawei.com>
>
> 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@huawei.com>
> ---
[...]

\
 
 \ /
  Last update: 2023-10-18 19:55    [W:0.111 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site