* [PATCH] net/bonding: Don't destroy bonding master wehn unensalving with a sysfs command
@ 2008-06-19 15:01 Moni Shoua
2008-06-25 14:08 ` Moni Shoua
0 siblings, 1 reply; 2+ messages in thread
From: Moni Shoua @ 2008-06-19 15:01 UTC (permalink / raw)
To: Jay Vosburgh; +Cc: Olga Stern, Or Gerlitz, netdev
It is wrong to destroy a bonding master from a context that uses the sysfs of
that bond. When last IPoIB slave is unenslaved from by writing to a sysfs
file (for bond0 this would be /sys/class/net/bond0/bonding/slaves) the driver
tries to destroy the bond. This is wrong and can lead to a lockup or a crash.
This fix lets the bonding master stay and relies on the user to destroy the
bonding master if necessary (i.e. before module ib_ipoib is unloaded)
This patch affects only bonds of IPoIB slaves. Ethernet slaves stay unaffected.
Signed-off-by: Moni Shoua <monis@voltaire.com>
---
drivers/net/bonding/bond_sysfs.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index 08f3d39..f66f590 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -351,9 +351,6 @@ static ssize_t bonding_store_slaves(struct device *d,
if (dev) {
printk(KERN_INFO DRV_NAME ": %s: Removing slave %s\n",
bond->dev->name, dev->name);
- if (bond->setup_by_slave)
- res = bond_release_and_destroy(bond->dev, dev);
- else
res = bond_release(bond->dev, dev);
if (res) {
ret = res;
--
1.5.5
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] net/bonding: Don't destroy bonding master wehn unensalving with a sysfs command
2008-06-19 15:01 [PATCH] net/bonding: Don't destroy bonding master wehn unensalving with a sysfs command Moni Shoua
@ 2008-06-25 14:08 ` Moni Shoua
0 siblings, 0 replies; 2+ messages in thread
From: Moni Shoua @ 2008-06-25 14:08 UTC (permalink / raw)
To: Jay Vosburgh; +Cc: Olga Stern, netdev
Moni Shoua wrote:
> It is wrong to destroy a bonding master from a context that uses the sysfs of
> that bond. When last IPoIB slave is unenslaved from by writing to a sysfs
> file (for bond0 this would be /sys/class/net/bond0/bonding/slaves) the driver
> tries to destroy the bond. This is wrong and can lead to a lockup or a crash.
> This fix lets the bonding master stay and relies on the user to destroy the
> bonding master if necessary (i.e. before module ib_ipoib is unloaded)
>
> This patch affects only bonds of IPoIB slaves. Ethernet slaves stay unaffected.
> Signed-off-by: Moni Shoua <monis@voltaire.com>
> ---
> drivers/net/bonding/bond_sysfs.c | 3 ---
> 1 files changed, 0 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
> index 08f3d39..f66f590 100644
> --- a/drivers/net/bonding/bond_sysfs.c
> +++ b/drivers/net/bonding/bond_sysfs.c
> @@ -351,9 +351,6 @@ static ssize_t bonding_store_slaves(struct device *d,
> if (dev) {
> printk(KERN_INFO DRV_NAME ": %s: Removing slave %s\n",
> bond->dev->name, dev->name);
> - if (bond->setup_by_slave)
> - res = bond_release_and_destroy(bond->dev, dev);
> - else
> res = bond_release(bond->dev, dev);
> if (res) {
> ret = res;
Hi Jay,
Could you please refer to this one?
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-06-25 14:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-19 15:01 [PATCH] net/bonding: Don't destroy bonding master wehn unensalving with a sysfs command Moni Shoua
2008-06-25 14:08 ` Moni Shoua
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).