[ 3.5.y.z extended stable ] Patch "bonding: remove already created master sysfs link on failure" has been added to staging queue
Luis Henriques
luis.henriques at canonical.com
Thu Apr 4 13:25:20 UTC 2013
This is a note to let you know that I have just added a patch titled
bonding: remove already created master sysfs link on failure
to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree
which can be found at:
http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.5.y-queue
If you, or anyone else, feels it should not be added to this tree, please
reply to this email.
For more information about the 3.5.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable
Thanks.
-Luis
------
>From 3aba4035f9cefc6869c1756e1cf35854099a14e5 Mon Sep 17 00:00:00 2001
From: Veaceslav Falico <vfalico at redhat.com>
Date: Tue, 26 Mar 2013 17:43:28 +0100
Subject: [PATCH] bonding: remove already created master sysfs link on failure
commit 9fe16b78ee17579cb4f333534cf7043e94c67024 upstream.
If slave sysfs symlink failes to be created - we end up without removing
the master sysfs symlink. Remove it in case of failure.
Signed-off-by: Veaceslav Falico <vfalico at redhat.com>
Signed-off-by: David S. Miller <davem at davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
drivers/net/bonding/bond_sysfs.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index 9ea29aa..97c33c2 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -183,6 +183,11 @@ int bond_create_slave_symlinks(struct net_device *master,
sprintf(linkname, "slave_%s", slave->name);
ret = sysfs_create_link(&(master->dev.kobj), &(slave->dev.kobj),
linkname);
+
+ /* free the master link created earlier in case of error */
+ if (ret)
+ sysfs_remove_link(&(slave->dev.kobj), "master");
+
return ret;
}
--
1.8.1.2
More information about the kernel-team
mailing list