datapath: dp_sysfs_add_dp() needs RTNL lock.
authorJesse Gross <jesse@nicira.com>
Wed, 8 Dec 2010 20:02:42 +0000 (12:02 -0800)
committerJesse Gross <jesse@nicira.com>
Fri, 10 Dec 2010 01:43:37 +0000 (17:43 -0800)
commitdad80ec3088c787d3fd876e8d3d11ad7b3f0f11b
tree6a327698a101c09fe420f8d262253b4c533cd6fd
parenteb0e14ed3f3a719b3cd5bef8cb3112e683e2a9dd
datapath: dp_sysfs_add_dp() needs RTNL lock.

We currently drop RTNL before adding a new datapath to sysfs but
then access the dp data structures.  This moves the call to
dp_sysfs_add_dp() before we drop the locks to prevent a potential
race.  All other calls to sysfs functions already hold RTNL.

Found with lockdep.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
datapath/datapath.c