netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Veaceslav Falico <vfalico@redhat.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, fubar@us.ibm.com, andy@greyhouse.net
Subject: Re: [PATCH net-next] bonding: fix send_peer_notif leekage on rtnl lock congestion
Date: Tue, 6 Aug 2013 14:17:01 +0200	[thread overview]
Message-ID: <20130806121701.GQ22756@redhat.com> (raw)
In-Reply-To: <20130805.161212.421332729798966037.davem@davemloft.net>

On Mon, Aug 05, 2013 at 04:12:12PM -0700, David Miller wrote:
>From: Veaceslav Falico <vfalico@redhat.com>
>Date: Mon,  5 Aug 2013 21:47:33 +0200
>
>> @@ -2999,7 +3002,10 @@ void bond_activebackup_arp_mon(struct work_struct *work)
>>  		if (!rtnl_trylock()) {
>>  			read_lock(&bond->lock);
>>  			delta_in_ticks = 1;
>> -			should_notify_peers = false;
>> +			if (should_notify_peers) {
>> +				bond->send_peer_notif++;
>
>I doubt this increment to a shared datastructure is safe with
>the locks you hold here.
>
>You don't hold RTNL and you only have bond->lock as a reader.

You're right, we can race here. This whole locking juggling should be
changed.

Self-NAK for this, I'll rework it.

      reply	other threads:[~2013-08-06 12:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-05 19:47 [PATCH net-next] bonding: fix send_peer_notif leekage on rtnl lock congestion Veaceslav Falico
2013-08-05 23:12 ` David Miller
2013-08-06 12:17   ` Veaceslav Falico [this message]

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=20130806121701.GQ22756@redhat.com \
    --to=vfalico@redhat.com \
    --cc=andy@greyhouse.net \
    --cc=davem@davemloft.net \
    --cc=fubar@us.ibm.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;
as well as URLs for NNTP newsgroup(s).