Skip to contentSkip to conversation

: Relax dances with genl_lock.

PATCH In review Pavel Emelyanov 2 participants 2 messages Feb 12, 2008 – Feb 13, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : Relax dances with genl_lock.

The genl_unregister_family() calls the genl_unregister_mc_groups(), which takes and releases the genl_lock and then locks and releases this lock itself.

Relax this behavior, all the more so the genl_unregister_mc_groups() is called from genl_unregister_family() only.

I'm not sure, whether this is 2.6.25 material, but the patch looks pretty simple. Should I hold it till 2.6.26?

---

net/netlink/genetlink.c +2 -4
index 150579a..d16929c 100644
@@ -230,10 +230,8 @@ static void genl_unregister_mc_groups(struct genl_family *family)
 {
 	struct genl_multicast_group *grp, *tmp;
 
-	genl_lock();
 	list_for_each_entry_safe(grp, tmp, &family->mcast_groups, list)
 		__genl_unregister_mc_group(family, grp);
-	genl_unlock();
 }
 
 /**
@@ -396,10 +394,10 @@ int genl_unregister_family(struct genl_family *family)
 {
 	struct genl_family *rc;
 
-	genl_unregister_mc_groups(family);
-
 	genl_lock();
 
+	genl_unregister_mc_groups(family);
+
 	list_for_each_entry(rc, genl_family_chain(family->id), family_list) {
 		if (family->id != rc->id || strcmp(rc->name, family->name))
 			continue;
maintainer
#1 lore raw

From: Pavel Emelyanov <[email protected]>
Date: Tue, 12 Feb 2008 20:16:13 +0300

Quoted 8 lines

The genl_unregister_family() calls the genl_unregister_mc_groups(), which takes and releases the genl_lock and then locks and releases this lock itself.

Relax this behavior, all the more so the genl_unregister_mc_groups() is called from genl_unregister_family() only.

Ok, applied, thanks.