* Re: [PATCH net-next 0/5] net: Consolidate metrics handling for ipv4 and ipv6
[not found] <20181005030755.31217-1-dsahern@kernel.org>
@ 2018-10-05 4:55 ` David Miller
2018-10-05 12:17 ` Eric Dumazet
0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2018-10-05 4:55 UTC (permalink / raw)
To: dsahern; +Cc: netdev, weiwan, sd, xiyou.wangcong, dsahern
From: David Ahern <dsahern@kernel.org>
Date: Thu, 4 Oct 2018 20:07:50 -0700
> From: David Ahern <dsahern@gmail.com>
>
> As part of the IPv6 fib info refactoring, the intent was to make metrics
> handling for ipv6 identical to ipv4. One oversight in ip6_dst_destroy
> led to confusion and a couple of incomplete attempts at finding and
> fixing the resulting memory leak which was ultimately resolved by
> ce7ea4af0838 ("ipv6: fix memory leak on dst->_metrics").
>
> Refactor metrics hanlding make the code really identical for v4 and v6,
> and add a few test cases.
Looks nice, series applied, thanks David.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next 0/5] net: Consolidate metrics handling for ipv4 and ipv6
2018-10-05 4:55 ` [PATCH net-next 0/5] net: Consolidate metrics handling for ipv4 and ipv6 David Miller
@ 2018-10-05 12:17 ` Eric Dumazet
2018-10-05 13:08 ` Eric Dumazet
0 siblings, 1 reply; 5+ messages in thread
From: Eric Dumazet @ 2018-10-05 12:17 UTC (permalink / raw)
To: David Miller, dsahern; +Cc: netdev, weiwan, sd, xiyou.wangcong, dsahern
On 10/04/2018 09:55 PM, David Miller wrote:
> From: David Ahern <dsahern@kernel.org>
> Date: Thu, 4 Oct 2018 20:07:50 -0700
>
>> From: David Ahern <dsahern@gmail.com>
>>
>> As part of the IPv6 fib info refactoring, the intent was to make metrics
>> handling for ipv6 identical to ipv4. One oversight in ip6_dst_destroy
>> led to confusion and a couple of incomplete attempts at finding and
>> fixing the resulting memory leak which was ultimately resolved by
>> ce7ea4af0838 ("ipv6: fix memory leak on dst->_metrics").
>>
>> Refactor metrics hanlding make the code really identical for v4 and v6,
>> and add a few test cases.
>
> Looks nice, series applied, thanks David.
>
Does not look well tested and reviewed to me.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next 0/5] net: Consolidate metrics handling for ipv4 and ipv6
2018-10-05 12:17 ` Eric Dumazet
@ 2018-10-05 13:08 ` Eric Dumazet
2018-10-05 15:37 ` David Ahern
2018-10-05 17:50 ` David Miller
0 siblings, 2 replies; 5+ messages in thread
From: Eric Dumazet @ 2018-10-05 13:08 UTC (permalink / raw)
To: Eric Dumazet, David Miller, dsahern
Cc: netdev, weiwan, sd, xiyou.wangcong, dsahern
On 10/05/2018 05:17 AM, Eric Dumazet wrote:
>
>
> On 10/04/2018 09:55 PM, David Miller wrote:
>> From: David Ahern <dsahern@kernel.org>
>> Date: Thu, 4 Oct 2018 20:07:50 -0700
>>
>>> From: David Ahern <dsahern@gmail.com>
>>>
>>> As part of the IPv6 fib info refactoring, the intent was to make metrics
>>> handling for ipv6 identical to ipv4. One oversight in ip6_dst_destroy
>>> led to confusion and a couple of incomplete attempts at finding and
>>> fixing the resulting memory leak which was ultimately resolved by
>>> ce7ea4af0838 ("ipv6: fix memory leak on dst->_metrics").
>>>
>>> Refactor metrics hanlding make the code really identical for v4 and v6,
>>> and add a few test cases.
>>
>> Looks nice, series applied, thanks David.
>>
>
> Does not look well tested and reviewed to me.
For some reason I have not received the patch series in my inbox, I only got
your "series applied" message.
Commit 767a2217533fed6 ("net: common metrics init helper for FIB entries")
is not correct because we need to better deal with error paths.
I will submit this more formally when I can reach my workstation in a few minutes :
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 6c1d817151cae45421dc976c5ea082b4115650be..74d97addf1af20dda0c2b6a2018e88696f9f7d5a 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2976,6 +2976,8 @@ static struct fib6_info *ip6_route_info_create(struct fib6_config *cfg,
rt->fib6_metrics = ip_fib_metrics_init(net, cfg->fc_mx, cfg->fc_mx_len);
if (IS_ERR(rt->fib6_metrics)) {
err = PTR_ERR(rt->fib6_metrics);
+ /* Do not leave garbage there. */
+ rt->fib6_metrics = (struct dst_metrics *)&dst_default_metrics;
goto out;
}
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net-next 0/5] net: Consolidate metrics handling for ipv4 and ipv6
2018-10-05 13:08 ` Eric Dumazet
@ 2018-10-05 15:37 ` David Ahern
2018-10-05 17:50 ` David Miller
1 sibling, 0 replies; 5+ messages in thread
From: David Ahern @ 2018-10-05 15:37 UTC (permalink / raw)
To: Eric Dumazet, David Miller, dsahern; +Cc: netdev, weiwan, sd, xiyou.wangcong
On 10/5/18 7:08 AM, Eric Dumazet wrote:
> Commit 767a2217533fed6 ("net: common metrics init helper for FIB entries")
> is not correct because we need to better deal with error paths.
>
> I will submit this more formally when I can reach my workstation in a few minutes :
>
> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
> index 6c1d817151cae45421dc976c5ea082b4115650be..74d97addf1af20dda0c2b6a2018e88696f9f7d5a 100644
> --- a/net/ipv6/route.c
> +++ b/net/ipv6/route.c
> @@ -2976,6 +2976,8 @@ static struct fib6_info *ip6_route_info_create(struct fib6_config *cfg,
> rt->fib6_metrics = ip_fib_metrics_init(net, cfg->fc_mx, cfg->fc_mx_len);
> if (IS_ERR(rt->fib6_metrics)) {
> err = PTR_ERR(rt->fib6_metrics);
> + /* Do not leave garbage there. */
> + rt->fib6_metrics = (struct dst_metrics *)&dst_default_metrics;
> goto out;
> }
>
>
Yes, I was focused on the memory leaks and cleanup and forgot to
purposely fail the alloc for the metrics. The above is one way to fix
it. Thanks for spotting it.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next 0/5] net: Consolidate metrics handling for ipv4 and ipv6
2018-10-05 13:08 ` Eric Dumazet
2018-10-05 15:37 ` David Ahern
@ 2018-10-05 17:50 ` David Miller
1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2018-10-05 17:50 UTC (permalink / raw)
To: eric.dumazet; +Cc: dsahern, netdev, weiwan, sd, xiyou.wangcong, dsahern
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 5 Oct 2018 06:08:57 -0700
> For some reason I have not received the patch series in my inbox, I
> only got your "series applied" message.
I see what happened.
I did something stupid on vger.kernel.org yesterday which ran a
partition out of disk space, and some postings got lost as a result.
Sorry about that.
> Commit 767a2217533fed6 ("net: common metrics init helper for FIB entries")
> is not correct because we need to better deal with error paths.
>
> I will submit this more formally when I can reach my workstation in a few minutes :
Thanks Eric.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-10-06 0:49 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20181005030755.31217-1-dsahern@kernel.org>
2018-10-05 4:55 ` [PATCH net-next 0/5] net: Consolidate metrics handling for ipv4 and ipv6 David Miller
2018-10-05 12:17 ` Eric Dumazet
2018-10-05 13:08 ` Eric Dumazet
2018-10-05 15:37 ` David Ahern
2018-10-05 17:50 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.