login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
April
»
1
Re: [Patch V2] bonding: fix potential deadlock in bond_uninit()
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Eric W. Biederman
Subject:
Re: [Patch V2] bonding: fix potential deadlock in bond_uninit()
Date: Wednesday, March 31, 2010 - 11:12 pm
Amerigo Wang <amwang@redhat.com> writes:
quoted text
> bond_uninit() is invoked with rtnl_lock held, when it does destroy_workqueue() > which will potentially flush all works in this workqueue, if we hold rtnl_lock > again in the work function, it will deadlock. > > So move destroy_workqueue() to destructor where rtnl_lock is not held any more, > suggested by Eric.
The error handling on creating a bond device needs to be updated as well. Eric
quoted text
> Signed-off-by: WANG Cong <amwang@redhat.com> > Cc: Jay Vosburgh <fubar@us.ibm.com> > Cc: "David S. Miller" <davem@davemloft.net> > Cc: Stephen Hemminger <shemminger@vyatta.com> > Cc: Jiri Pirko <jpirko@redhat.com> > Cc: "Eric W. Biederman" <ebiederm@xmission.com> > > --- > > diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c > index 5b92fbf..9f0aaa2 100644 > --- a/drivers/net/bonding/bond_main.c > +++ b/drivers/net/bonding/bond_main.c > @@ -4450,6 +4450,14 @@ static const struct net_device_ops bond_netdev_ops = { > .ndo_vlan_rx_kill_vid = bond_vlan_rx_kill_vid, > }; > > +static void bond_destructor(struct net_device *bond_dev) > +{ > + struct bonding *bond = netdev_priv(bond_dev); > + if (bond->wq) > + destroy_workqueue(bond->wq); > + free_netdev(bond_dev); > +} > + > static void bond_setup(struct net_device *bond_dev) > { > struct bonding *bond = netdev_priv(bond_dev); > @@ -4470,7 +4478,7 @@ static void bond_setup(struct net_device *bond_dev) > bond_dev->ethtool_ops = &bond_ethtool_ops; > bond_set_mode_ops(bond, bond->params.mode); > > - bond_dev->destructor = free_netdev; > + bond_dev->destructor = bond_destructor; > > /* Initialize the device options */ > bond_dev->tx_queue_len = 0; > @@ -4542,9 +4550,6 @@ static void bond_uninit(struct net_device *bond_dev) > > bond_remove_proc_entry(bond); > > - if (bond->wq) > - destroy_workqueue(bond->wq); > - > netif_addr_lock_bh(bond_dev); > bond_mc_list_destroy(bond); > netif_addr_unlock_bh(bond_dev);
--
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[Patch V2] bonding: fix potential deadlock in bond_uninit()
, Amerigo Wang
, (Wed Mar 31, 11:06 pm)
Re: [Patch V2] bonding: fix potential deadlock in bond_uni ...
, Eric W. Biederman
, (Wed Mar 31, 11:12 pm)
Re: [Patch V2] bonding: fix potential deadlock in bond_uni ...
, Cong Wang
, (Wed Mar 31, 11:54 pm)
[Patch V3] bonding: fix potential deadlock in bond_uninit()
, Cong Wang
, (Thu Apr 1, 12:30 am)
Re: [Patch V3] bonding: fix potential deadlock in bond_uni ...
, David Miller
, (Thu Apr 1, 5:26 pm)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Brandeburg, Jesse
RE: [regression] e1000e broke e1000 (was: Re: [ANNOUNCE] e1000 toe1000e migration ...
Robin Lee Powell
NFS hang + umount -f: better behaviour requested.
Linus Torvalds
Linux 2.6.34-rc4
Nick Piggin
Re: dealing with barriers (was Re: [PATCH] firewire: fw-core: enforce write order ...
Joe Perches
Re: [patch] checkpatch: putting the && or || on the wrong line
git
:
Fredrik Kuivinen
Re: fatal: unable to create '.git/index': File exists
Johannes Sixt
Re: How to pull remote branch with specified commit id?
Henrik Vendelbo
only accessing some git repos: Am I configuring daemon wrong?
Johannes Schindelin
Re: git and mtime
Martin Langhoff
Re: CVS -> SVN -> Git
linux-netdev
:
Jamie Lokier
Re: POHMELFS high performance network filesystem. Transactions, failover, performa...
Paulius Zaleckas
Re: [RFC] Patch to option HSO driver to the kernel
Timo Teräs
ip xfrm policy semantics
Ron Mercer
[net-next PATCH 2/2] qlge: Version change to v1.00.00.27
Maciej W. Rozycki
Re: [PATCH] flush_work_sync vs. flush_scheduled_work Re: [PATCH] PHYLIB: IRQ event...
openbsd-misc
:
Sevan / Venture37
Re: This is what Linus Torvalds calls openBSD crowd
Siju George
This is what Linus Torvalds calls openBSD crowd
new_guy
Longest Uptime?
Skylar Hawk
Re: asus eee 1201n - acpitz0 critical temperature 255C (5282K), shutting down
Nick Guenther
Re: Forum engine
git-commits-head
:
Linux Kernel Mailing List
powerpc/fsl_msi: enable msi allocation in all banks
Linux Kernel Mailing List
[ARM] mmp: avengers lite (pxa168) board bring up
Linux Kernel Mailing List
swiotlb: replace architecture-specific swiotlb.h with linux/swiotlb.h
Linux Kernel Mailing List
drivers/acpi: use kasprintf
Linux Kernel Mailing List
V4L/DVB (10925): add support for LG Electronics LGDT3305 ATSC/QAM-B Demodulator
Colocation donated by:
Syndicate