netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: fubar@us.ibm.com
Cc: netdev@vger.kernel.org, jgarzik@pobox.com, xemul@openvz.org
Subject: Re: [PATCH 3/4] bonding: Deadlock between bonding_store_bonds and bond_destroy_sysfs.
Date: Fri, 02 May 2008 17:51:53 -0700 (PDT)	[thread overview]
Message-ID: <20080502.175153.47024492.davem@davemloft.net> (raw)
In-Reply-To: <12097757842821-git-send-email-fubar@us.ibm.com>

From: Jay Vosburgh <fubar@us.ibm.com>
Date: Fri,  2 May 2008 17:49:39 -0700

> From: Pavel Emelyanov <xemul@openvz.org>
> 
> The sysfs layer has an internal protection, that ensures, that
> all the process sitting inside ->sore/->show callback exits
> before the appropriate entry is unregistered (the calltraces
> are rather big, but I can provide them if required).
> 
> On the other hand, bonding takes rtnl_lock in
> a) the bonding_store_bonds, i.e. in ->store callback,
> b) module exit before calling the sysfs unregister routines.
> 
> Thus, the classical AB-BA deadlock may occur. To reproduce run
> # while :; do modprobe bonding; rmmod bonding; done
> and
> # while :; do echo '+bond%d' > /sys/class/net/bonding_masters ; done
> in parallel.
> 
> The fix is to move the bond_destroy_sysfs out of the rtnl_lock,
> but _before_ bond_free_all to make sure no bonding devices exist
> after module unload.
> 
> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
> Acked-by: Jay Vosburgh <fubar@us.ibm.com>

Acked-by: David S. Miller <davem@davemloft.net>

  parent reply	other threads:[~2008-05-03  0:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-03  0:49 [PATCH 0/4] bonding: bug fixes for 2.6.26 Jay Vosburgh
2008-05-03  0:49 ` [PATCH 1/4] bonding: Do not call free_netdev for already registered device Jay Vosburgh
2008-05-03  0:49   ` [PATCH 2/4] bonding: fix error unwind in bonding_store_bonds Jay Vosburgh
2008-05-03  0:49     ` [PATCH 3/4] bonding: Deadlock between bonding_store_bonds and bond_destroy_sysfs Jay Vosburgh
2008-05-03  0:49       ` [PATCH 4/4] bonding: fix enslavement error unwinds Jay Vosburgh
2008-05-03  0:52         ` David Miller
2008-05-03  1:06           ` [PATCH REPOST " Jay Vosburgh
2008-05-03  1:07             ` David Miller
2008-05-03  0:51       ` David Miller [this message]
2008-05-03  0:51     ` [PATCH 2/4] bonding: fix error unwind in bonding_store_bonds David Miller
2008-05-03  0:51   ` [PATCH 1/4] bonding: Do not call free_netdev for already registered device David Miller
2008-05-06 16:17   ` Jeff Garzik

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=20080502.175153.47024492.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=fubar@us.ibm.com \
    --cc=jgarzik@pobox.com \
    --cc=netdev@vger.kernel.org \
    --cc=xemul@openvz.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).