Commit 6d6936e2 authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by John W. Linville

Fix potential scheduling while atomic in mesh_path_add.

Calling synchronize_rcu() under write-lock-ed pathtbl_resize_lock may
result in this warning (and other side effects).

It looks safe just dropping this lock before calling synchronize_rcu.
Signed-off-by: default avatarPavel Emelyanov <xemul@openvz.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 0eb03d5a
...@@ -220,9 +220,10 @@ int mesh_path_add(u8 *dst, struct net_device *dev) ...@@ -220,9 +220,10 @@ int mesh_path_add(u8 *dst, struct net_device *dev)
return -ENOMEM; return -ENOMEM;
} }
rcu_assign_pointer(mesh_paths, newtbl); rcu_assign_pointer(mesh_paths, newtbl);
write_unlock(&pathtbl_resize_lock);
synchronize_rcu(); synchronize_rcu();
mesh_table_free(oldtbl, false); mesh_table_free(oldtbl, false);
write_unlock(&pathtbl_resize_lock);
} }
endadd2: endadd2:
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment