From: David Miller <davem@davemloft.net>
To: xemul@openvz.org
Cc: yoshfuji@linux-ipv6.org, netdev@vger.kernel.org, devel@openvz.org
Subject: Re: [PATCH 2/3] Lost locking in fl6_sock_lookup
Date: Thu, 18 Oct 2007 05:14:26 -0700 (PDT) [thread overview]
Message-ID: <20071018.051426.102573633.davem@davemloft.net> (raw)
In-Reply-To: <47174D8E.2050200@openvz.org>
From: Pavel Emelyanov <xemul@openvz.org>
Date: Thu, 18 Oct 2007 16:11:58 +0400
> YOSHIFUJI Hideaki wrote:
> > In article <47174950.6060409@openvz.org> (at Thu, 18 Oct 2007 15:53:52 +0400), Pavel Emelyanov <xemul@openvz.org> says:
> >
> >> This routine scans the ipv6_fl_list whose update is
> >> protected with the socket lock and the ip6_sk_fl_lock.
> >
> >> struct ip6_flowlabel *fl = sfl->fl;
> >> if (fl->label == label) {
> >> + read_unlock_bh(&ip6_sk_fl_lock);
> >> fl->lastuse = jiffies;
> >> atomic_inc(&fl->users);
> >> return fl;
> >
> > We should increment fl->users within the critical section, shouldn't we?
>
> Not necessary. The users is more than zero (because it is
> linked in the sock's list) so garbage collector won't catch
> it in any way.
Right, we're grabbing an "extra" reference here and only
someone who gets the socket lock (which we have) can unlink
it and thus potentially drop the count to zero.
next prev parent reply other threads:[~2007-10-18 12:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-18 11:53 [PATCH 2/3] Lost locking in fl6_sock_lookup Pavel Emelyanov
2007-10-18 12:00 ` YOSHIFUJI Hideaki / 吉藤英明
2007-10-18 12:11 ` Pavel Emelyanov
2007-10-18 12:14 ` David Miller [this message]
2007-10-18 12:16 ` David Miller
2007-10-18 12:22 ` Pavel Emelyanov
2007-10-18 12:33 ` 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=20071018.051426.102573633.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=devel@openvz.org \
--cc=netdev@vger.kernel.org \
--cc=xemul@openvz.org \
--cc=yoshfuji@linux-ipv6.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;
as well as URLs for NNTP newsgroup(s).