Commit 15feb56e authored by Jiri Pirko's avatar Jiri Pirko Committed by Jakub Kicinski

net: devlink: move netdev notifier block to dest namespace during reload

The notifier block tracking netdev changes in devlink is registered
during devlink_alloc() per-net, it is then unregistered
in devlink_free(). When devlink moves from net namespace to another one,
the notifier block needs to move along.

Fix this by adding forgotten call to move the block.
Reported-by: default avatarIdo Schimmel <idosch@idosch.org>
Fixes: 02a68a47 ("net: devlink: track netdev with devlink_port assigned")
Reviewed-by: default avatarIdo Schimmel <idosch@nvidia.com>
Tested-by: default avatarIdo Schimmel <idosch@nvidia.com>
Signed-off-by: default avatarJiri Pirko <jiri@nvidia.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 3e52fba0
...@@ -4502,8 +4502,11 @@ static int devlink_reload(struct devlink *devlink, struct net *dest_net, ...@@ -4502,8 +4502,11 @@ static int devlink_reload(struct devlink *devlink, struct net *dest_net,
if (err) if (err)
return err; return err;
if (dest_net && !net_eq(dest_net, curr_net)) if (dest_net && !net_eq(dest_net, curr_net)) {
move_netdevice_notifier_net(curr_net, dest_net,
&devlink->netdevice_nb);
write_pnet(&devlink->_net, dest_net); write_pnet(&devlink->_net, dest_net);
}
err = devlink->ops->reload_up(devlink, action, limit, actions_performed, extack); err = devlink->ops->reload_up(devlink, action, limit, actions_performed, extack);
devlink_reload_failed_set(devlink, !!err); devlink_reload_failed_set(devlink, !!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