Thread (8 messages) flat view 8 messages, 3 authors, 2017-09-27

Re: [PATCH net] ipv6: remove incorrect WARN_ON() in fib6_del()

From: Wei Wang <hidden>
Date: 2017-09-26 01:16:09

On Mon, Sep 25, 2017 at 5:56 PM, Martin KaFai Lau [off-list ref] wrote:
On Mon, Sep 25, 2017 at 05:35:22PM +0000, Wei Wang wrote:
quoted
From: Wei Wang <redacted>

fib6_del() generates WARN_ON() when rt->dst.obsolete > 0. This does not
make sense because it is possible that the route passed in is already
deleted by some other thread and rt->dst.obsolete is set to
DST_OBSOLETE_DEAD.
So this commit deletes this WARN_ON() and also remove the
"#ifdef RT6_DEBUG >= 2" condition so that if the route is already
obsolete, we return right at the beginning of fib6_del().

diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index e5308d7cbd75..693bcd7ef6d2 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -1592,13 +1592,7 @@ int fib6_del(struct rt6_info *rt, struct nl_info *info)
      struct net *net = info->nl_net;
      struct rt6_info **rtp;

-#if RT6_DEBUG >= 2
-     if (rt->dst.obsolete > 0) {
-             WARN_ON(fn);
fn should have already been set to NULL if it is removed
from the fib6 tree?
That is true. rt->rt6i_node (fn) should already be marked as NULL.
That means the check on rt->dst.obsolete is redundant.
I will remove it in v2.
Thanks Martin.

quoted
-             return -ENOENT;
-     }
-#endif
-     if (!fn || rt == net->ipv6.ip6_null_entry)
+     if (!fn || rt->dst.obsolete > 0 || rt == net->ipv6.ip6_null_entry)
              return -ENOENT;

      WARN_ON(!(fn->fn_flags & RTN_RTINFO));
--
2.14.1.821.g8fa685d3b7-goog
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help