Thread (12 messages) 12 messages, 2 authors, 2023-10-19

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

From: Song Liu <song@kernel.org>
Date: 2023-10-18 17:54:17
Also in: lkml

On Sun, Oct 15, 2023 at 6:28 PM Yu Kuai [off-list ref] wrote:
From: Yu Kuai <redacted>

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 <redacted>
---
[...]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help