Skip to content

Commit d465bd0

Browse files
q2venkuba-moo
authored andcommitted
ipv6: Pass gfp_flags down to ip6_route_info_create_nh().
Since commit c4837b9 ("ipv6: Split ip6_route_info_create()."), ip6_route_info_create_nh() uses GFP_ATOMIC as it was expected to be called under RCU. Now, we can call it without RCU and use GFP_KERNEL. Let's pass gfp_flags to ip6_route_info_create_nh(). Signed-off-by: Kuniyuki Iwashima <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 5e4a8cc commit d465bd0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

net/ipv6/route.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3834,6 +3834,7 @@ static struct fib6_info *ip6_route_info_create(struct fib6_config *cfg,
38343834

38353835
static int ip6_route_info_create_nh(struct fib6_info *rt,
38363836
struct fib6_config *cfg,
3837+
gfp_t gfp_flags,
38373838
struct netlink_ext_ack *extack)
38383839
{
38393840
struct net *net = cfg->fc_nlinfo.nl_net;
@@ -3869,7 +3870,7 @@ static int ip6_route_info_create_nh(struct fib6_info *rt,
38693870
} else {
38703871
int addr_type;
38713872

3872-
err = fib6_nh_init(net, rt->fib6_nh, cfg, GFP_ATOMIC, extack);
3873+
err = fib6_nh_init(net, rt->fib6_nh, cfg, gfp_flags, extack);
38733874
if (err)
38743875
goto out_release;
38753876

@@ -3917,7 +3918,7 @@ int ip6_route_add(struct fib6_config *cfg, gfp_t gfp_flags,
39173918
if (IS_ERR(rt))
39183919
return PTR_ERR(rt);
39193920

3920-
err = ip6_route_info_create_nh(rt, cfg, extack);
3921+
err = ip6_route_info_create_nh(rt, cfg, gfp_flags, extack);
39213922
if (err)
39223923
return err;
39233924

@@ -4707,7 +4708,7 @@ struct fib6_info *addrconf_f6i_alloc(struct net *net,
47074708
if (IS_ERR(f6i))
47084709
return f6i;
47094710

4710-
err = ip6_route_info_create_nh(f6i, &cfg, extack);
4711+
err = ip6_route_info_create_nh(f6i, &cfg, gfp_flags, extack);
47114712
if (err)
47124713
return ERR_PTR(err);
47134714

@@ -5471,7 +5472,7 @@ static int ip6_route_multipath_add(struct fib6_config *cfg,
54715472
goto cleanup;
54725473
}
54735474

5474-
err = ip6_route_info_create_nh(rt, &r_cfg, extack);
5475+
err = ip6_route_info_create_nh(rt, &r_cfg, GFP_KERNEL, extack);
54755476
if (err) {
54765477
rt = NULL;
54775478
goto cleanup;

0 commit comments

Comments
 (0)