netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] fix generic netlink locking issue(s)
@ 2013-08-21 14:08 Johannes Berg
  2013-08-21 14:08 ` [PATCH 1/2] Revert "genetlink: fix family dump race" Johannes Berg
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Johannes Berg @ 2013-08-21 14:08 UTC (permalink / raw)
  To: netdev; +Cc: Thomas Graf

Here's another attempt at fixing the genetlink locking issue,
hopefully better tested this time. Sorry about the mess the 
previous version caused.

I really didn't find a way to "simply" add locking, no matter
which way I turn genetlink is special because it would then use
the same locks "inside" and "outside" the generic netlink family;
"inside" because I'm trying to protect the otherwise unlocked
dump call, and "outside" because it itself is a generic netlink
family so needs to protect things there.

As a result, I've turned to RCU and (hopefully) made it safe.
The unregistration can get fairly expensive with all the calls
to synchronize_rcu(), but I don't see any better way, and it's
hopefully really rare.

The only place that now uses RCU is ctrl_dumpfamily(), but it'd
be possible to use it in other places. I didn't want to do it
in this patch, but I also don't see any candidates where that 
would really make sense. 

The first patch should obviously go into 3.11, I'll let you 
decide about the second. This one might actually be easier to
backport than the original one, but it'd still have to be done
carefully.

johannes

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-08-22 21:28 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-21 14:08 [PATCH 0/2] fix generic netlink locking issue(s) Johannes Berg
2013-08-21 14:08 ` [PATCH 1/2] Revert "genetlink: fix family dump race" Johannes Berg
2013-08-22  4:29   ` Pravin Shelar
2013-08-22 20:26   ` David Miller
2013-08-22 20:36     ` Johannes Berg
2013-08-22 21:27       ` Pravin Shelar
2013-08-21 14:08 ` [PATCH 2/2] genetlink: convert family dump code to use RCU Johannes Berg
2013-08-22  4:32   ` Pravin Shelar
2013-08-22  7:17     ` Johannes Berg
2013-08-21 19:05 ` [PATCH 0/2] fix generic netlink locking issue(s) Oliver Hartkopp
2013-08-21 22:53   ` Pravin Shelar
2013-08-22  6:51     ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).