synchronize_rcu() is moved into ip_set_swap() in order not to burden
ip_set_destroy() unnecessarily when all sets are destroyed
Signed-off-by: Jozsef Kadlecsik <kadlec@netfilter.org>
if (unlikely(protocol_min_failed(attr)))
return -IPSET_ERR_PROTOCOL;
- /* Make sure all readers of the old set pointers are completed. */
- synchronize_rcu();
-
/* Must wait for flush to be really finished in list:set */
rcu_barrier();
ip_set(inst, to_id) = from;
write_unlock_bh(&ip_set_ref_lock);
+ /* Make sure all readers of the old set pointers are completed. */
+ synchronize_rcu();
+
return 0;
}