[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <059d608901fd86407fed374e567c46447aa8c88f.1458134414.git.lucien.xin@gmail.com>
Date: Wed, 16 Mar 2016 21:34:44 +0800
From: Xin Long <lucien.xin@...il.com>
To: network dev <netdev@...r.kernel.org>
Cc: davem@...emloft.net,
Hannes Frederic Sowa <hannes@...essinduktion.org>,
nikolay@...ulusnetworks.com
Subject: [PATCH net-next 1/6] bridge: add rtnl_lock in fdb_flush in br_sysfs_br.c
In fdb_delete, it will send rtnl msg, so before that, we should
hold rtnl_lock in the function that call it in sysfs.
Signed-off-by: Xin Long <lucien.xin@...il.com>
---
net/bridge/br_sysfs_br.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c
index 6b80914..095a751 100644
--- a/net/bridge/br_sysfs_br.c
+++ b/net/bridge/br_sysfs_br.c
@@ -345,7 +345,12 @@ static ssize_t flush_store(struct device *d,
if (!ns_capable(dev_net(br->dev)->user_ns, CAP_NET_ADMIN))
return -EPERM;
+ if (!rtnl_trylock())
+ return restart_syscall();
+
br_fdb_flush(br);
+ rtnl_unlock();
+
return len;
}
static DEVICE_ATTR_WO(flush);
--
2.1.0
Powered by blists - more mailing lists