From: Michael Ellerman <michael@ellerman.id.au>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: netdev@vger.kernel.org
Subject: Re: Freeing alive fib_info caused by ebc0ffae5
Date: Thu, 04 Nov 2010 22:35:26 +1100 [thread overview]
Message-ID: <1288870526.30549.19.camel@concordia> (raw)
In-Reply-To: <1288869699.2659.77.camel@edumazet-laptop>
[-- Attachment #1: Type: text/plain, Size: 1301 bytes --]
On Thu, 2010-11-04 at 12:21 +0100, Eric Dumazet wrote:
>
> Hmm, a review of the code spotted a bug in fib_result_assign()
>
> Please try following patch :
>
> Thanks again !
>
> [PATCH] fib: fib_result_assign() should not change fib refcounts
>
> After commit ebc0ffae5 (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: Michael Ellerman <michael@ellerman.id.au>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> ---
> net/ipv4/fib_lookup.h | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/net/ipv4/fib_lookup.h b/net/ipv4/fib_lookup.h
> index a29edf2..c079cc0 100644
> --- a/net/ipv4/fib_lookup.h
> +++ b/net/ipv4/fib_lookup.h
> @@ -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,
> struct fib_info *fi)
> {
> - if (res->fi != NULL)
> - fib_info_put(res->fi);
> + /* we used to play games with refcounts, but we now use RCU */
> res->fi = fi;
> - if (fi != NULL)
> - atomic_inc(&fi->fib_clntref);
> }
>
> #endif /* _FIB_LOOKUP_H */
Perfect, that fixes it, thanks!
cheers
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2010-11-04 11:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-04 10:23 Freeing alive fib_info caused by ebc0ffae5 Michael Ellerman
2010-11-04 10:30 ` Eric Dumazet
2010-11-04 10:46 ` Eric Dumazet
2010-11-04 11:21 ` Eric Dumazet
2010-11-04 11:23 ` Michael Ellerman
2010-11-04 11:35 ` Michael Ellerman [this message]
2010-11-04 19:06 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1288870526.30549.19.camel@concordia \
--to=michael@ellerman.id.au \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox