From: Jesse Gross Date: Wed, 29 Dec 2010 23:05:02 +0000 (-0800) Subject: datapath: Don't check for RCU in free_buckets in table. X-Git-Tag: v1.1.0~545 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=633d3ac7dc4ac473a4e2a4f7bff32f3023b45cf6;p=sliver-openvswitch.git datapath: Don't check for RCU in free_buckets in table. free_buckets() is only called in places where the lifetime of its container has ended: on allocation failure and on deletion after a grace period. If the container can no longer be referenced then neither can the buckets, so it is safe to directly free them. sparse complains if the pointer is directly dereferenced and lockdep complains if the RCU functions are used without some type of lock, both of which are fine in this case. This adds an explicit cast to avoid the complaints. Found with lockdep. Signed-off-by: Jesse Gross Acked-by: Ben Pfaff --- diff --git a/datapath/table.c b/datapath/table.c index 5c1b82a4b..b54534a6d 100644 --- a/datapath/table.c +++ b/datapath/table.c @@ -51,7 +51,7 @@ static void free_buckets(struct tbl_bucket __rcu ***l1, unsigned int j; for (j = 0; j < TBL_L2_SIZE; j++) { - struct tbl_bucket *bucket = rcu_dereference(l2[j]); + struct tbl_bucket *bucket = (struct tbl_bucket __force *)l2[j]; if (!bucket) continue;