[GENETLINK]: Relax dances with genl_lock.

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <git-commits-head@...>
Date: Friday, February 15, 2008 - 6:00 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=910d6c...
Commit:     910d6c320cac65c81d66e8fd30dca167092722eb
Parent:     4c3a0a254e5d706d3fe01bf42261534858d05586
Author:     Pavel Emelyanov <xemul@openvz.org>
AuthorDate: Tue Feb 12 22:16:33 2008 -0800
Committer:  David S. Miller <davem@davemloft.net>
CommitDate: Tue Feb 12 22:16:33 2008 -0800

    [GENETLINK]: 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.
    
    Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>
---
 net/netlink/genetlink.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
index 150579a..d16929c 100644
--- a/net/netlink/genetlink.c
+++ b/net/netlink/genetlink.c
@@ -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;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[GENETLINK]: Relax dances with genl_lock., Linux Kernel Mailing List..., (Fri Feb 15, 6:00 pm)