On Wed, Jan 8, 2020 at 1:36 PM John Fastabend <john.fastabend@xxxxxxxxx> wrote: > > Now that we depend on rcu_call() and synchronize_rcu() to also wait > for preempt_disabled region to complete the rcu read critical section > in __dev_map_flush() is no longer relevant. > > These originally ensured the map reference was safe while a map was > also being free'd. But flush by new rules can only be called from > preempt-disabled NAPI context. The synchronize_rcu from the map free > path and the rcu_call from the delete path will ensure the reference > here is safe. So lets remove the rcu_read_lock and rcu_read_unlock > pair to avoid any confusion around how this is being protected. > > If the rcu_read_lock was required it would mean errors in the above > logic and the original patch would also be wrong. > > Fixes: 0536b85239b84 ("xdp: Simplify devmap cleanup") > Signed-off-by: John Fastabend <john.fastabend@xxxxxxxxx> Acked-by: Song Liu <songliubraving@xxxxxx>