synchronize_rcu()
is used to waits only for ongoing RCU read-side critical sections to complete. If so, it should been blocked forever when beening called inside a read block. However, the following code works well on my linux kernel, why?
void port_range_clean( void )
{
struct port_range *p;
redo:
rcu_read_lock();
list_for_each_entry_rcu(p, &port_rt->ports, list) {
list_del_rcu(&p->list);
synchronize_rcu();
rcu_read_unlock();
kfree(p);
goto redo;
}
}