Re: 2.6.18-rc4-mm3: BUG: warning at include/net/dst.h:154/dst_release()

From: Frederik Deweerdt
Date: Tue Aug 29 2006 - 12:17:26 EST


On Tue, Aug 29, 2006 at 10:25:07AM -0400, Valdis.Kletnieks@xxxxxx wrote:
> Seeing this a lot on 2.6.18-rc4-mm3 with 2 different stack tracebacks
> (one for received packets, other for sending). I already picked up the
> fix for the ^ / confusion in fib_rules.c and that didn't help matters.
>
Hi,

I'm not familiary with net code, but willing to help :). It looks like
the fib6_rule_lookup function is increasing dst.__refcnt in one code
path and not the other. Does the (untested) attached patch help?

Thanks,
Frederik

diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c
index ee4aa43..12ec27b 100644
--- a/net/ipv6/fib6_rules.c
+++ b/net/ipv6/fib6_rules.c
@@ -67,8 +67,11 @@ struct dst_entry *fib6_rule_lookup(struc
if (arg.rule)
fib_rule_put(arg.rule);

- if (arg.result)
- return (struct dst_entry *) arg.result;
+ if (arg.result) {
+ struct dst_entry *dst = (struct dst_entry *)arg.result;
+ dst_hold(dst);
+ return dst;
+ }

dst_hold(&ip6_null_entry.u.dst);
return &ip6_null_entry.u.dst;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/