summaryrefslogtreecommitdiff
path: root/net/bridge/br_sysfs_br.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2009-05-13 17:00:41 +0000
committerDavid S. Miller <davem@davemloft.net>2009-05-18 22:15:59 -0700
commitaf38f2989572704a846a5577b5ab3b1e2885cbfb (patch)
treed706c0e977992c360f484399886abd0e0c33de58 /net/bridge/br_sysfs_br.c
parent9b8adb5ea005fe73acd5dd58f9bd47eafa74c9d1 (diff)
downloadlwn-af38f2989572704a846a5577b5ab3b1e2885cbfb.tar.gz
lwn-af38f2989572704a846a5577b5ab3b1e2885cbfb.zip
net: Fix bridgeing sysfs handling of rtnl_lock
Holding rtnl_lock when we are unregistering the sysfs files can deadlock if we unconditionally take rtnl_lock in a sysfs file. So fix it with the now familiar patter of: rtnl_trylock and syscall_restart() Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_sysfs_br.c')
-rw-r--r--net/bridge/br_sysfs_br.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c
index 603d89248e71..ee4820aa1843 100644
--- a/net/bridge/br_sysfs_br.c
+++ b/net/bridge/br_sysfs_br.c
@@ -172,7 +172,8 @@ static ssize_t store_stp_state(struct device *d,
if (endp == buf)
return -EINVAL;
- rtnl_lock();
+ if (!rtnl_trylock())
+ return restart_syscall();
br_stp_set_enabled(br, val);
rtnl_unlock();