Thread (2 messages) flat view 2 messages, 1 author, 2009-06-19

Re: [PATCH] genetlink: make netns aware

From: Johannes Berg <johannes@sipsolutions.net>
Date: 2009-06-19 01:12:37

On Thu, 2009-06-18 at 13:17 +0200, Johannes Berg wrote:
This makes generic netlink network namespace aware.
Please drop this patch, it has a deadlock bug.
+int genlmsg_multicast(struct sk_buff *skb, u32 pid,
+		      unsigned int group, gfp_t flags)
+{
+	int ret;
+
+	if (flags & GFP_ATOMIC) {
+		rcu_read_lock();
+		ret = genlmsg_mcast(skb, pid, group, flags);
+		rcu_read_unlock();
+	} else {
+		rtnl_lock();
+		ret = genlmsg_mcast(skb, pid, group, flags);
+		rtnl_unlock();
+	}
+
+	return ret;
+}
It used to be possible to call genlmsg_multicast() under rtnl, which
will now obviously deadlock unless you also make it GFP_ATOMIC... I'm
inclined to always use RCU here to solve that, comments?

johannes

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help