提交 1f1b9c99 编写于 作者: E Eric Dumazet 提交者: David S. Miller

fib: fib_result_assign() should not change fib refcounts

After commit ebc0ffae (RCU conversion of fib_lookup()),
fib_result_assign()  should not change fib refcounts anymore.

Thanks to Michael who did the bisection and bug report.
Reported-by: NMichael Ellerman <michael@ellerman.id.au>
Tested-by: NMichael Ellerman <michael@ellerman.id.au>
Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 cccbe5ef
...@@ -47,11 +47,8 @@ extern int fib_detect_death(struct fib_info *fi, int order, ...@@ -47,11 +47,8 @@ extern int fib_detect_death(struct fib_info *fi, int order,
static inline void fib_result_assign(struct fib_result *res, static inline void fib_result_assign(struct fib_result *res,
struct fib_info *fi) struct fib_info *fi)
{ {
if (res->fi != NULL) /* we used to play games with refcounts, but we now use RCU */
fib_info_put(res->fi);
res->fi = fi; res->fi = fi;
if (fi != NULL)
atomic_inc(&fi->fib_clntref);
} }
#endif /* _FIB_LOOKUP_H */ #endif /* _FIB_LOOKUP_H */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册